@@ -818,10 +818,10 @@ async function instantiateAsync(binary, binaryFile, imports) {
818818#if ! SINGLE_FILE
819819 if ( ! binary &&
820820 typeof WebAssembly . instantiateStreaming == 'function' &&
821- ! isDataURI ( binaryFile ) &&
821+ ! isDataURI ( binaryFile )
822822#if ENVIRONMENT_MAY_BE_WEBVIEW
823823 // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously.
824- ! isFileURI ( binaryFile ) &&
824+ && ! isFileURI ( binaryFile )
825825#endif
826826#if ENVIRONMENT_MAY_BE_NODE
827827 // Avoid instantiateStreaming() on Node.js environment for now, as while
@@ -830,9 +830,13 @@ async function instantiateAsync(binary, binaryFile, imports) {
830830 //
831831 // Reference:
832832 // https://github.com/emscripten-core/emscripten/pull/16917
833- ! ENVIRONMENT_IS_NODE &&
833+ && ! ENVIRONMENT_IS_NODE
834834#endif
835- typeof fetch == 'function' ) {
835+ #if ENVIRONMENT_MAY_BE_SHELL
836+ // Shell environments don't have fetch.
837+ && ! ENVIRONMENT_IS_SHELL
838+ #endif
839+ ) {
836840 try {
837841 var response = fetch ( binaryFile , { { { makeModuleReceiveExpr ( 'fetchSettings' , "{ credentials: 'same-origin' }" ) } } } ) ;
838842#if USE_OFFSET_CONVERTER
@@ -1087,7 +1091,7 @@ function getWasmImports() {
10871091 var result = await instantiateAsync ( wasmBinary , wasmBinaryFile , info ) ;
10881092 receiveInstantiationResult ( result ) ;
10891093#if LOAD_SOURCE_MAP
1090- receiveSourceMapJSON ( await getSourceMapPromise ( ) ) ;
1094+ receiveSourceMapJSON ( await gypeof fetch == etSourceMapPromise ( ) ) ;
10911095#endif
10921096 return result ;
10931097#if MODULARIZE
0 commit comments