Skip to content

Commit c513aed

Browse files
authored
Use JS Set rather than list for ALL_INCOMING_MODULE_JS_API. NFC (#19286)
The only use of this setting was checking for membership so this should be faster.
1 parent 5aee123 commit c513aed

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/compiler.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ EXPORTED_FUNCTIONS = new Set(EXPORTED_FUNCTIONS);
6868
WASM_EXPORTS = new Set(WASM_EXPORTS);
6969
SIDE_MODULE_EXPORTS = new Set(SIDE_MODULE_EXPORTS);
7070
INCOMING_MODULE_JS_API = new Set(INCOMING_MODULE_JS_API);
71+
ALL_INCOMING_MODULE_JS_API = new Set(ALL_INCOMING_MODULE_JS_API);
7172
WEAK_IMPORTS = new Set(WEAK_IMPORTS);
7273
if (symbolsOnly) {
7374
INCLUDE_FULL_LIBRARY = 1;

src/parseTools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ function makeRemovedModuleAPIAssert(moduleName, localName) {
732732
function checkReceiving(name) {
733733
// ALL_INCOMING_MODULE_JS_API contains all valid incoming module API symbols
734734
// so calling makeModuleReceive* with a symbol not in this list is an error
735-
assert(ALL_INCOMING_MODULE_JS_API.includes(name));
735+
assert(ALL_INCOMING_MODULE_JS_API.has(name));
736736
}
737737

738738
// Make code to receive a value on the incoming Module object.

0 commit comments

Comments
 (0)