@@ -48,7 +48,7 @@ function run() {
4848}
4949#endif
5050
51- function initRuntime ( asm ) {
51+ function initRuntime ( wasmExports ) {
5252#if ASSERTIONS || SAFE_HEAP || USE_ASAN
5353 runtimeInitialized = true ;
5454#endif
@@ -77,11 +77,11 @@ function initRuntime(asm) {
7777#endif
7878
7979#if PTHREADS
80- PThread . tlsInitFunctions . push ( asm [ '_emscripten_tls_init' ] ) ;
80+ PThread . tlsInitFunctions . push ( wasmExports [ '_emscripten_tls_init' ] ) ;
8181#endif
8282
8383#if hasExportedSymbol ( '__wasm_call_ctors' )
84- asm [ '__wasm_call_ctors' ] ( ) ;
84+ wasmExports [ '__wasm_call_ctors' ] ( ) ;
8585#endif
8686
8787 < << ATINITS >>>
@@ -101,7 +101,7 @@ var imports = {
101101// In non-fastcomp non-asm.js builds, grab wasm exports to outer scope
102102// for emscripten_get_exported_function() to be able to access them.
103103#if LibraryManager . has ( 'library_exports.js' )
104- var asm ;
104+ var wasmExports ;
105105#endif
106106
107107#if PTHREADS
@@ -142,7 +142,7 @@ WebAssembly.instantiate(Module['wasm'], imports).then((output) => {
142142
143143#if ! LibraryManager . has ( 'library_exports.js' ) && ! EMBIND
144144 // If not using the emscripten_get_exported_function() API or embind, keep the
145- // `asm` exports variable in local scope to this instantiate function to save
145+ // `wasmExports` variable in local scope to this instantiate function to save
146146 // code size. (otherwise access it without to export it to outer scope)
147147 var
148148#endif
@@ -163,16 +163,16 @@ WebAssembly.instantiate(Module['wasm'], imports).then((output) => {
163163 // that case, 'output' is a WebAssembly.Instance.
164164 // In main thread, Module['wasm'] is either a typed array or a fetch stream.
165165 // In that case, 'output.instance' is the WebAssembly.Instance.
166- asm = ( output . instance || output ) . exports ;
166+ wasmExports = ( output . instance || output ) . exports ;
167167#else
168- asm = output . exports ;
168+ wasmExports = output . exports ;
169169#endif
170170#else
171- asm = output . instance . exports ;
171+ wasmExports = output . instance . exports ;
172172#endif
173173
174174#if MEMORY64 || CAN_ADDRESS_2GB
175- asm = applySignatureConversions ( asm ) ;
175+ wasmExports = applySignatureConversions ( wasmExports ) ;
176176#endif
177177
178178#if USE_OFFSET_CONVERTER
@@ -183,11 +183,11 @@ WebAssembly.instantiate(Module['wasm'], imports).then((output) => {
183183#endif
184184
185185#if ! DECLARE_ASM_MODULE_EXPORTS
186- exportAsmFunctions ( asm ) ;
186+ exportAsmFunctions ( wasmExports ) ;
187187#else
188188 < << WASM_MODULE_EXPORTS >>>
189189#endif
190- wasmTable = asm [ '__indirect_function_table' ] ;
190+ wasmTable = wasmExports [ '__indirect_function_table' ] ;
191191#if ASSERTIONS
192192 assert ( wasmTable ) ;
193193#endif
@@ -211,7 +211,7 @@ WebAssembly.instantiate(Module['wasm'], imports).then((output) => {
211211#endif
212212
213213#if ! IMPORTED_MEMORY
214- wasmMemory = asm [ 'memory' ] ;
214+ wasmMemory = wasmExports [ 'memory' ] ;
215215#if ASSERTIONS
216216 assert ( wasmMemory ) ;
217217 assert ( wasmMemory . buffer . byteLength === { { { INITIAL_MEMORY } } } ) ;
@@ -226,7 +226,7 @@ WebAssembly.instantiate(Module['wasm'], imports).then((output) => {
226226 HEAPU8 . set ( new Uint8Array ( Module [ 'mem' ] ) , { { { GLOBAL_BASE } } } ) ;
227227#endif
228228
229- initRuntime ( asm ) ;
229+ initRuntime ( wasmExports ) ;
230230#if PTHREADS
231231 // Export Wasm module for pthread creation to access.
232232 wasmModule = output . module || Module [ 'wasm' ] ;
0 commit comments