Skip to content

Commit d4e0c2a

Browse files
authored
Don't use wasm streaming if fetch is not available (e.g. SpiderMonkey shell) (#5729)
1 parent 5773f3c commit d4e0c2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/preamble.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,10 @@ function integrateWasmJS() {
23192319
});
23202320
}
23212321
// Prefer streaming instantiation if available.
2322-
if (!Module['wasmBinary'] && typeof WebAssembly.instantiateStreaming === 'function' && wasmBinaryFile.indexOf('data:') !== 0) {
2322+
if (!Module['wasmBinary'] &&
2323+
typeof WebAssembly.instantiateStreaming === 'function' &&
2324+
wasmBinaryFile.indexOf('data:') !== 0 &&
2325+
typeof fetch === 'function') {
23232326
WebAssembly.instantiateStreaming(fetch(wasmBinaryFile, { credentials: 'same-origin' }), info)
23242327
.then(receiveInstantiatedSource)
23252328
.catch(function(reason) {

0 commit comments

Comments
 (0)