From 883d14de7157950063f74b81658d00df0d53be8d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 12 Apr 2019 15:45:10 -0700 Subject: 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) --- scripts/test/node-esm-loader.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/test/node-esm-loader.mjs') 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, -- cgit v1.2.3