summaryrefslogtreecommitdiff
path: root/scripts/test/node-esm-loader.mjs
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-07-28 10:57:23 -0700
committerGitHub <noreply@github.com>2019-07-28 10:57:23 -0700
commit6ac5fa713b421588eede2e791235e4b60b22b172 (patch)
treecab48897fe2a54325b6144469ecce0a3e2e6eb4a /scripts/test/node-esm-loader.mjs
parent772891f6270c20c34f3dc1d3984cffc6fa824d02 (diff)
downloadbinaryen-6ac5fa713b421588eede2e791235e4b60b22b172.tar.gz
binaryen-6ac5fa713b421588eede2e791235e4b60b22b172.tar.bz2
binaryen-6ac5fa713b421588eede2e791235e4b60b22b172.zip
wasm2js: Mangle import names for JS (#2267)
This fixes names that would be invalid in JS, like a.b. Turns out the Go compiler emits wasm with such imports. Also add some docs on how to use wasm2js. Fixes #2263
Diffstat (limited to 'scripts/test/node-esm-loader.mjs')
-rw-r--r--scripts/test/node-esm-loader.mjs5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/test/node-esm-loader.mjs b/scripts/test/node-esm-loader.mjs
index 8cd722822..5d41033fb 100644
--- a/scripts/test/node-esm-loader.mjs
+++ b/scripts/test/node-esm-loader.mjs
@@ -16,9 +16,8 @@ export function resolve(specifier, parentModuleURL = baseURL, defaultResolve) {
format: 'builtin'
};
}
- // Resolve the 'spectest' and 'env' modules to our custom implementations of
- // various builtins.
- if (specifier == 'spectest' || specifier == 'env') {
+ // Resolve special modules used in our test suite.
+ if (specifier == 'spectest' || specifier == 'env' || specifier == 'mod.ule') {
const resolved = new URL('./scripts/test/' + specifier + '.js', parentModuleURL);
return {
url: resolved.href,