1111var threadInfoStruct = 0 ; // Info area for this thread in Emscripten HEAP (shared). If zero, this worker is not currently hosting an executing pthread.
1212var selfThreadId = 0 ; // The ID of this thread. 0 if not hosting a pthread.
1313var parentThreadId = 0 ; // The ID of the parent pthread that launched this thread.
14- #if ! WASM_BACKEND
14+ #if ! WASM_BACKEND && ! MODULARIZE
1515var tempDoublePtr = 0 ; // A temporary memory area for global float and double marshalling operations.
1616#endif
1717
@@ -59,10 +59,6 @@ this.addEventListener('error', function(e) {
5959 console . error ( e . error ) ;
6060} ) ;
6161
62- function threadPrint ( ) {
63- var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
64- console . log ( text ) ;
65- }
6662function threadPrintErr ( ) {
6763 var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
6864 console . error ( text ) ;
@@ -72,20 +68,19 @@ function threadAlert() {
7268 var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
7369 postMessage ( { cmd : 'alert' , text : text , threadId : selfThreadId } ) ;
7470}
75- out = threadPrint ;
76- err = threadPrintErr ;
71+ var err = threadPrintErr ;
7772this . alert = threadAlert ;
7873
7974#if WASM
8075Module [ 'instantiateWasm' ] = function ( info , receiveInstance ) {
8176 // Instantiate from the module posted from the main thread.
8277 // We can just use sync instantiation in the worker.
83- instance = new WebAssembly . Instance ( wasmModule , info ) ;
78+ var instance = new WebAssembly . Instance ( wasmModule , info ) ;
8479 // We don't need the module anymore; new threads will be spawned from the main thread.
8580 wasmModule = null ;
8681 receiveInstance ( instance ) ; // The second 'module' parameter is intentionally null here, we don't need to keep a ref to the Module object from here.
8782 return instance . exports ;
88- }
83+ } ;
8984#endif
9085
9186var wasmModule ;
@@ -275,4 +270,4 @@ this.onmessage = function(e) {
275270 console . error ( e . stack ) ;
276271 throw e ;
277272 }
278- }
273+ } ;
0 commit comments