Skip to content

Commit 443352e

Browse files
authored
[parseTools.mjs] Remove receivedSymbol helper function. NFC (#25527)
It only had a single remaining usage.
1 parent 8fc4d1f commit 443352e

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

src/parseTools.mjs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -966,16 +966,6 @@ function hasExportedSymbol(sym) {
966966
return WASM_EXPORTS.has(sym);
967967
}
968968

969-
// Called when global runtime symbols such as wasmMemory, wasmExports and
970-
// wasmTable are set. In this case we maybe need to re-export them on the
971-
// Module object.
972-
function receivedSymbol(sym) {
973-
if (EXPORTED_RUNTIME_METHODS.has(sym)) {
974-
return `Module['${sym}'] = ${sym};`;
975-
}
976-
return '';
977-
}
978-
979969
// JS API I64 param handling: if we have BigInt support, the ABI is simple,
980970
// it is a BigInt. Otherwise, we legalize into pairs of i32s.
981971
export function defineI64Param(name) {
@@ -1232,7 +1222,6 @@ addToCompileTimeContext({
12321222
nodeDetectionCode,
12331223
receiveI64ParamAsI53,
12341224
receiveI64ParamAsI53Unchecked,
1235-
receivedSymbol,
12361225
runIfMainThread,
12371226
runIfWorkerThread,
12381227
runtimeKeepalivePop,

src/preamble.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,9 @@ function getWasmImports() {
712712
wasmExports = applySignatureConversions(wasmExports);
713713
#endif
714714

715-
{{{ receivedSymbol('wasmExports') }}}
715+
#if EXPORTED_RUNTIME_METHODS.includes('wasmExports')
716+
Module['wasmExports'] = wasmExports;
717+
#endif
716718

717719
#if PTHREADS
718720
#if MAIN_MODULE

test/codesize/test_codesize_minimal_O0.expected.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,6 @@ async function createWasm() {
674674
function receiveInstance(instance, module) {
675675
wasmExports = instance.exports;
676676

677-
678-
679677
assignWasmExports(wasmExports);
680678

681679
updateMemoryViews();
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"hello_world.js": 55508,
3-
"hello_world.js.gz": 17499,
2+
"hello_world.js": 55502,
3+
"hello_world.js.gz": 17496,
44
"hello_world.wasm": 15127,
55
"hello_world.wasm.gz": 7450,
6-
"no_asserts.js": 26614,
7-
"no_asserts.js.gz": 8877,
6+
"no_asserts.js": 26608,
7+
"no_asserts.js.gz": 8874,
88
"no_asserts.wasm": 12227,
99
"no_asserts.wasm.gz": 6010,
10-
"strict.js": 53523,
11-
"strict.js.gz": 16823,
10+
"strict.js": 53517,
11+
"strict.js.gz": 16822,
1212
"strict.wasm": 15127,
1313
"strict.wasm.gz": 7447,
14-
"total": 178126,
15-
"total_gz": 64106
14+
"total": 178108,
15+
"total_gz": 64099
1616
}

0 commit comments

Comments
 (0)