Skip to content

Commit 1d6e0d0

Browse files
committed
Replace globalThis polyfill in exportWasmSymbols. NFC
1 parent 300a596 commit 1d6e0d0

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/lib/libcore.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,20 +1650,12 @@ addToLibrary({
16501650
#if !DECLARE_ASM_MODULE_EXPORTS
16511651
// When DECLARE_ASM_MODULE_EXPORTS is not set we export native symbols
16521652
// at runtime rather than statically in JS code.
1653-
$exportWasmSymbols__deps: ['$asmjsMangle'
1653+
$exportWasmSymbols__deps: ['$asmjsMangle', '$emGlobalThis',
16541654
#if DYNCALLS || !WASM_BIGINT
16551655
, '$dynCalls'
16561656
#endif
16571657
],
16581658
$exportWasmSymbols: (wasmExports) => {
1659-
#if ENVIRONMENT_MAY_BE_NODE && ENVIRONMENT_MAY_BE_WEB
1660-
var global_object = (typeof process != "undefined" ? global : this);
1661-
#elif ENVIRONMENT_MAY_BE_NODE
1662-
var global_object = global;
1663-
#else
1664-
var global_object = this;
1665-
#endif
1666-
16671659
for (var [name, exportedSymbol] of Object.entries(wasmExports)) {
16681660
name = asmjsMangle(name);
16691661
#if DYNCALLS || !WASM_BIGINT
@@ -1676,9 +1668,9 @@ addToLibrary({
16761668
// similar DECLARE_ASM_MODULE_EXPORTS = 0 treatment.
16771669
if (typeof exportedSymbol.value === 'undefined') {
16781670
#if MINIMAL_RUNTIME
1679-
global_object[name] = exportedSymbol;
1671+
emGlobalThis[name] = exportedSymbol;
16801672
#else
1681-
global_object[name] = Module[name] = exportedSymbol;
1673+
emGlobalThis[name] = Module[name] = exportedSymbol;
16821674
#endif
16831675
}
16841676
}

0 commit comments

Comments
 (0)