11
11
var threadInfoStruct = 0 ; // Info area for this thread in Emscripten HEAP (shared). If zero, this worker is not currently hosting an executing pthread.
12
12
var selfThreadId = 0 ; // The ID of this thread. 0 if not hosting a pthread.
13
13
var parentThreadId = 0 ; // The ID of the parent pthread that launched this thread.
14
- #if ! WASM_BACKEND
14
+ #if ! WASM_BACKEND && ! MODULARIZE
15
15
var tempDoublePtr = 0 ; // A temporary memory area for global float and double marshalling operations.
16
16
#endif
17
17
@@ -59,10 +59,6 @@ this.addEventListener('error', function(e) {
59
59
console . error ( e . error ) ;
60
60
} ) ;
61
61
62
- function threadPrint ( ) {
63
- var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
64
- console . log ( text ) ;
65
- }
66
62
function threadPrintErr ( ) {
67
63
var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
68
64
console . error ( text ) ;
@@ -72,20 +68,19 @@ function threadAlert() {
72
68
var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
73
69
postMessage ( { cmd : 'alert' , text : text , threadId : selfThreadId } ) ;
74
70
}
75
- out = threadPrint ;
76
- err = threadPrintErr ;
71
+ var err = threadPrintErr ;
77
72
this . alert = threadAlert ;
78
73
79
74
#if WASM
80
75
Module [ 'instantiateWasm' ] = function ( info , receiveInstance ) {
81
76
// Instantiate from the module posted from the main thread.
82
77
// We can just use sync instantiation in the worker.
83
- instance = new WebAssembly . Instance ( wasmModule , info ) ;
78
+ var instance = new WebAssembly . Instance ( wasmModule , info ) ;
84
79
// We don't need the module anymore; new threads will be spawned from the main thread.
85
80
wasmModule = null ;
86
81
receiveInstance ( instance ) ; // The second 'module' parameter is intentionally null here, we don't need to keep a ref to the Module object from here.
87
82
return instance . exports ;
88
- }
83
+ } ;
89
84
#endif
90
85
91
86
var wasmModule ;
@@ -275,4 +270,4 @@ this.onmessage = function(e) {
275
270
console . error ( e . stack ) ;
276
271
throw e ;
277
272
}
278
- }
273
+ } ;
0 commit comments