summaryrefslogtreecommitdiff
path: root/test/wasm2js/deterministic.2asm.js.opt
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-10-05 15:18:22 -0700
committerGitHub <noreply@github.com>2022-10-05 15:18:22 -0700
commitc43721a1ae80539aea5ea9d8d295b7e377aa03f5 (patch)
tree4a796dd8baa33f6edd44b16addb967483f6b1479 /test/wasm2js/deterministic.2asm.js.opt
parent9b5ba422bf670754a5ac4fb39b0199ac8e1edb84 (diff)
downloadbinaryen-c43721a1ae80539aea5ea9d8d295b7e377aa03f5.tar.gz
binaryen-c43721a1ae80539aea5ea9d8d295b7e377aa03f5.tar.bz2
binaryen-c43721a1ae80539aea5ea9d8d295b7e377aa03f5.zip
wasm2js: Support for flexible module import naming (#5114)
The previous code was making emscripten-specific assumptions about imports basically all coming from the `env` module. I can't find a way to make this backwards compatible so may do a combined roll with the emscripten-side change: https://github.com/emscripten-core/emscripten/pull/17806
Diffstat (limited to 'test/wasm2js/deterministic.2asm.js.opt')
-rw-r--r--test/wasm2js/deterministic.2asm.js.opt6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/wasm2js/deterministic.2asm.js.opt b/test/wasm2js/deterministic.2asm.js.opt
index 4c9e0a139..a5bc1b337 100644
--- a/test/wasm2js/deterministic.2asm.js.opt
+++ b/test/wasm2js/deterministic.2asm.js.opt
@@ -2,8 +2,8 @@
var bufferView;
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -45,6 +45,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(65536);
var retasmFunc = asmFunc({
+ "env": {
memory: { buffer : memasmFunc }
+ },
});
export var foo = retasmFunc.foo;