@@ -285,8 +285,9 @@ def compute_minimal_runtime_initializer_and_exports(post, initializers, exports,
285285
286286 # Generate assignments from all asm.js/wasm exports out to the JS variables above: e.g. a = asm['a']; b = asm['b'];
287287 post = post .replace ('/*** ASM_MODULE_EXPORTS ***/' , receiving )
288+ receiving = ''
288289
289- return post
290+ return post , receiving
290291
291292
292293def function_tables_and_exports (funcs , metadata , mem_init , glue , forwarded_data , outfile , DEBUG ):
@@ -416,8 +417,7 @@ def define_asmjs_import_names(imports):
416417 post = apply_static_code_hooks (post )
417418
418419 if shared .Settings .MINIMAL_RUNTIME :
419- post = compute_minimal_runtime_initializer_and_exports (post , metadata ['initializers' ], shared .Settings .MODULE_EXPORTS , receiving )
420- receiving = ''
420+ post , receiving = compute_minimal_runtime_initializer_and_exports (post , metadata ['initializers' ], shared .Settings .MODULE_EXPORTS , receiving )
421421
422422 function_tables_impls = make_function_tables_impls (function_table_data )
423423 final_function_tables = '\n ' .join (function_tables_impls ) + '\n ' + function_tables_defs
@@ -2274,8 +2274,7 @@ def emscript_wasm_backend(infile, outfile, memfile, compiler_engine,
22742274 receiving = create_receiving_wasm (exports )
22752275
22762276 if shared .Settings .MINIMAL_RUNTIME :
2277- post = compute_minimal_runtime_initializer_and_exports (post , metadata ['initializers' ], exports , receiving )
2278- receiving = ''
2277+ post , receiving = compute_minimal_runtime_initializer_and_exports (post , metadata ['initializers' ], exports , receiving )
22792278
22802279 module = create_module_wasm (sending , receiving , invoke_funcs , metadata )
22812280
0 commit comments