diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-04-12 15:45:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 15:45:10 -0700 |
commit | 883d14de7157950063f74b81658d00df0d53be8d (patch) | |
tree | ce0eb6bd6f8ba344e41861f3280f5248427072e7 /scripts/test/node-esm-loader.mjs | |
parent | 53badfbea40e78eadf652735d247649948e0b9a9 (diff) | |
download | binaryen-883d14de7157950063f74b81658d00df0d53be8d.tar.gz binaryen-883d14de7157950063f74b81658d00df0d53be8d.tar.bz2 binaryen-883d14de7157950063f74b81658d00df0d53be8d.zip |
Wasm2js memory fixes (#2003)
* I64ToI32Lowering - don't assume address 0 is a hardcoded location for scratch memory. Import __tempMemory__ for that.
* RemoveNonJSOps - also use __tempMemory__. Oddly here the address was a hardcoded 1024 (perhaps where the rust program put a static global?).
* Support imported ints in wasm2js, coercing them as needed.
* Add "env" import support in the tests, since now we emit imports from there.
* Make wasm2js tests split out multi-module tests using split_wast which is more robust and avoids emitting multiple outputs in one file (which makes no sense for ES6 modules)
Diffstat (limited to 'scripts/test/node-esm-loader.mjs')
-rw-r--r-- | scripts/test/node-esm-loader.mjs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/test/node-esm-loader.mjs b/scripts/test/node-esm-loader.mjs index 73ff47800..8cd722822 100644 --- a/scripts/test/node-esm-loader.mjs +++ b/scripts/test/node-esm-loader.mjs @@ -16,14 +16,16 @@ export function resolve(specifier, parentModuleURL = baseURL, defaultResolve) { format: 'builtin' }; } - // Resolve the 'spectest' module to our special module which has some builtins - if (specifier == 'spectest') { - const resolved = new URL('./scripts/test/spectest.js', parentModuleURL); + // Resolve the 'spectest' and 'env' modules to our custom implementations of + // various builtins. + if (specifier == 'spectest' || specifier == 'env') { + const resolved = new URL('./scripts/test/' + specifier + '.js', parentModuleURL); return { url: resolved.href, format: 'esm' }; } + const resolved = new URL(specifier, parentModuleURL); return { url: resolved.href, |