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); }, 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')