You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION under node. NFC (#24782)
We cannot actually use this API under node since the fetch API doesn't
support local files.
However, this failure was going undetected for two reason:
1. The test was only looking for the string 'hello' in the output which
also appears in backtraces.
2. The instantiation error was being swallowed by a catch block that
simply printed the error the console, so the node process was exiting
with success.
Copy file name to clipboardExpand all lines: src/postamble_minimal.js
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -108,13 +108,17 @@ var imports = {
108
108
109
109
#if MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION
110
110
// https://caniuse.com/#feat=wasm and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming
// Module['wasm'] should contain a typed array of the Wasm object data, or a
114
114
// precompiled WebAssembly Module.
115
115
assert(WebAssembly.instantiateStreaming||Module['wasm'],'Must load WebAssembly Module in to variable Module.wasm before adding compiled output .js script to the DOM');
116
116
#endif
117
117
(WebAssembly.instantiateStreaming
118
+
#if ENVIRONMENT_MAY_BE_NODE
119
+
// Node's fetch API cannot be used for local files, so we cannot use instantiateStreaming
0 commit comments