@@ -16,7 +16,7 @@ var workerID = 0;
16
16
17
17
if ( ENVIRONMENT_IS_PTHREAD ) {
18
18
#if ! MINIMAL_RUNTIME
19
- var wasmPromiseResolve ;
19
+ var wasmModuleReceived ;
20
20
#endif
21
21
22
22
#if ENVIRONMENT_MAY_BE_NODE
@@ -62,27 +62,6 @@ if (ENVIRONMENT_IS_PTHREAD) {
62
62
}
63
63
self . alert = threadAlert ;
64
64
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
-
86
65
// Turn unhandled rejected promises into errors so that the main thread will be
87
66
// notified about them.
88
67
self . onunhandledrejection = ( e ) => { throw e . reason || e ; } ;
@@ -164,7 +143,7 @@ if (ENVIRONMENT_IS_PTHREAD) {
164
143
Module [ 'wasm' ] = msgData . wasmModule ;
165
144
loadModule ( ) ;
166
145
#else
167
- wasmPromiseResolve ( msgData . wasmModule ) ;
146
+ wasmModuleReceived ( msgData . wasmModule ) ;
168
147
#endif // MINIMAL_RUNTIME
169
148
} else if ( cmd === 'run' ) {
170
149
#if ASSERTIONS
0 commit comments