@@ -16,7 +16,7 @@ var workerID = 0;
1616
1717if ( ENVIRONMENT_IS_PTHREAD ) {
1818#if ! MINIMAL_RUNTIME
19- var wasmPromiseResolve ;
19+ var wasmModuleReceived ;
2020#endif
2121
2222#if ENVIRONMENT_MAY_BE_NODE
@@ -62,27 +62,6 @@ if (ENVIRONMENT_IS_PTHREAD) {
6262 }
6363 self . alert = threadAlert ;
6464
65- #if ! MINIMAL_RUNTIME
66- Module [ 'instantiateWasm' ] = ( info , receiveInstance ) => {
67- return new Promise ( ( resolve ) => {
68- wasmPromiseResolve = ( module ) => {
69- // Instantiate from the module posted from the main thread.
70- // We can just use sync instantiation in the worker.
71- var instance = new WebAssembly . Instance ( module , getWasmImports ( ) ) ;
72- #if RELOCATABLE || MAIN_MODULE
73- receiveInstance ( instance , module ) ;
74- #else
75- // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193,
76- // the above line no longer optimizes out down to the following line.
77- // When the regression is fixed, we can remove this if/else.
78- receiveInstance ( instance ) ;
79- #endif
80- resolve ( ) ;
81- } ;
82- } ) ;
83- }
84- #endif
85-
8665 // Turn unhandled rejected promises into errors so that the main thread will be
8766 // notified about them.
8867 self . onunhandledrejection = ( e ) => { throw e . reason || e ; } ;
@@ -164,7 +143,7 @@ if (ENVIRONMENT_IS_PTHREAD) {
164143 Module [ 'wasm' ] = msgData . wasmModule ;
165144 loadModule ( ) ;
166145#else
167- wasmPromiseResolve ( msgData . wasmModule ) ;
146+ wasmModuleReceived ( msgData . wasmModule ) ;
168147#endif // MINIMAL_RUNTIME
169148 } else if ( cmd === 'run' ) {
170149#if ASSERTIONS
0 commit comments