From f4c29da1b0b8d41f3a22e615f86cbe5af889fab8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Oct 2025 13:28:01 +0530 Subject: [PATCH 1/2] fix #25556 --- src/lib/libcore.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/libcore.js b/src/lib/libcore.js index 60798aec8b8c3..b5718b749851d 100644 --- a/src/lib/libcore.js +++ b/src/lib/libcore.js @@ -1632,16 +1632,13 @@ addToLibrary({ dynCalls[name.substr(8)] = exportedSymbol; } #endif - // Globals are currently statically enumerated into the output JS. - // TODO: If the number of Globals grows large, consider giving them a - // similar DECLARE_ASM_MODULE_EXPORTS = 0 treatment. - if (typeof exportedSymbol.value === 'undefined') { + // Export all symbols (both functions and globals) to the global scope + // when DECLARE_ASM_MODULE_EXPORTS=0 #if MINIMAL_RUNTIME - globalThis[name] = exportedSymbol; + globalThis[name] = exportedSymbol; #else - globalThis[name] = Module[name] = exportedSymbol; + globalThis[name] = Module[name] = exportedSymbol; #endif - } } exportAliases(wasmExports); }, From d09a20424731c6b38a09cb994482a40826c3e3aa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Oct 2025 13:51:27 +0530 Subject: [PATCH 2/2] removed @no_omit_asm_module_exports --- test/test_core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_core.py b/test/test_core.py index 0356186905712..876703172bb46 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -9711,7 +9711,6 @@ def test_externref_emjs(self, dynlink): 'dylink': [True], }) @no_esm_integration('https://github.com/emscripten-core/emscripten/issues/25543') - @no_omit_asm_module_exports('https://github.com/emscripten-core/emscripten/issues/25556') def test_wasm_global(self, dynlink): if '-flto' in self.cflags or '-flto=thin' in self.cflags: self.skipTest('https://github.com/emscripten-core/emscripten/issues/25555')