Skip to content

Commit 9f31dd8

Browse files
committed
esm: fix wasm import name in error message
Report the rejected import name instead of the import module when throwing for reserved Wasm import names. Signed-off-by: hyemimi <hyemi7375@gmail.com>
1 parent bb76938 commit 9f31dd8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/internal/modules/esm/translators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ translators.set('wasm', function(url, translateContext) {
581581
throw new WebAssembly.LinkError(`Invalid Wasm import "${impt.module}" in ${url}`);
582582
}
583583
if (impt.name.startsWith('wasm:') || impt.name.startsWith('wasm-js:')) {
584-
throw new WebAssembly.LinkError(`Invalid Wasm import name "${impt.module}" in ${url}`);
584+
throw new WebAssembly.LinkError(`Invalid Wasm import name "${impt.name}" in ${url}`);
585585
}
586586
importsList.add(impt.module);
587587
}

0 commit comments

Comments
 (0)