Skip to content

Commit 71e0500

Browse files
authored
Fix !DECLARE_ASM_MODULE_EXPORTS tests after #25298. NFC (#25319)
In !DECLARE_ASM_MODULE_EXPORTS that wasm symbols are all programmatically exported onto the Module object, and after #25298 that includes the `wasmMemory` symbol. This happens even for symbols that were not included in EXPORTED_FUNCTIONS or EXPORTED_RUNTIME_SYMBOLS. In many of these tests `wasmMemory` was not being exported and so that `unexportedRuntimeSymbol` helper was installing a property accessor on the `Module` object, which did not all of the assignment within `exportWasmSymbols`. An alternative here would be to limit the list of symbols that `exportWasmSymbols` assigns to the `Module` object but that would only increase code size for very little benefit.
1 parent c9acde2 commit 71e0500

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ jobs:
694694
wasmfs.test_fs_llseek_rawfs
695695
wasmfs.test_freetype
696696
minimal0.test_utf
697+
omitexports0.test_asyncify_longjmp
698+
strict.test_no_declare_asm_module_exports
697699
"
698700
test-modularize-instance:
699701
executor: focal

src/runtime_debug.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ function unexportedRuntimeSymbol(sym) {
154154
msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
155155
}
156156
abort(msg);
157-
}
157+
},
158+
#if !DECLARE_ASM_MODULE_EXPORTS
159+
// !DECLARE_ASM_MODULE_EXPORTS programmatically exports all wasm symbols
160+
// on the Module object. Ignore these attempts to set the properties
161+
// here.
162+
set(value) {}
163+
#endif
158164
});
159165
}
160166
}

test/codesize/test_codesize_minimal_O0.expected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ function unexportedRuntimeSymbol(sym) {
413413
msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';
414414
}
415415
abort(msg);
416-
}
416+
},
417417
});
418418
}
419419
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"hello_world.js": 54151,
3-
"hello_world.js.gz": 17086,
2+
"hello_world.js": 54152,
3+
"hello_world.js.gz": 17088,
44
"hello_world.wasm": 15127,
55
"hello_world.wasm.gz": 7450,
66
"no_asserts.js": 26557,
77
"no_asserts.js.gz": 8869,
88
"no_asserts.wasm": 12227,
99
"no_asserts.wasm.gz": 6010,
10-
"strict.js": 52189,
11-
"strict.js.gz": 16421,
10+
"strict.js": 52190,
11+
"strict.js.gz": 16422,
1212
"strict.wasm": 15127,
1313
"strict.wasm.gz": 7447,
14-
"total": 175378,
15-
"total_gz": 63283
14+
"total": 175380,
15+
"total_gz": 63286
1616
}

0 commit comments

Comments
 (0)