@flowscripter/template-bun-wasm-rust-library 1.3.9 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pkg/flowscripter_template_bun_wasm_rust_library.js +5 -1
- package/dist/pkg/flowscripter_template_bun_wasm_rust_library_bg.wasm +0 -0
- package/package.json +1 -1
- package/pkg/flowscripter_template_bun_wasm_rust_library.js +5 -1
- package/pkg/flowscripter_template_bun_wasm_rust_library_bg.wasm +0 -0
|
@@ -50,11 +50,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
50
50
|
|
|
51
51
|
async function __wbg_load(module, imports) {
|
|
52
52
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
53
|
+
if (!module.ok) {
|
|
54
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
54
58
|
try {
|
|
55
59
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
56
60
|
} catch (e) {
|
|
57
|
-
const validResponse =
|
|
61
|
+
const validResponse = expectedResponseType(module.type);
|
|
58
62
|
|
|
59
63
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
60
64
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -50,11 +50,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
50
50
|
|
|
51
51
|
async function __wbg_load(module, imports) {
|
|
52
52
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
53
|
+
if (!module.ok) {
|
|
54
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
54
58
|
try {
|
|
55
59
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
56
60
|
} catch (e) {
|
|
57
|
-
const validResponse =
|
|
61
|
+
const validResponse = expectedResponseType(module.type);
|
|
58
62
|
|
|
59
63
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
60
64
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
Binary file
|