From c43721a1ae80539aea5ea9d8d295b7e377aa03f5 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 5 Oct 2022 15:18:22 -0700 Subject: 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 --- test/wasm2js/unaligned.2asm.js.opt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/wasm2js/unaligned.2asm.js.opt') diff --git a/test/wasm2js/unaligned.2asm.js.opt b/test/wasm2js/unaligned.2asm.js.opt index 3178bb364..701a839ea 100644 --- a/test/wasm2js/unaligned.2asm.js.opt +++ b/test/wasm2js/unaligned.2asm.js.opt @@ -1,4 +1,4 @@ -import { setTempRet0 } from 'env'; +import * as env from 'env'; var bufferView; @@ -27,8 +27,7 @@ import { setTempRet0 } from 'env'; return f32ScratchView[2]; } -function asmFunc(importObject) { - var env = importObject.env || importObject; +function asmFunc(imports) { var buffer = new ArrayBuffer(65536); var HEAP8 = new Int8Array(buffer); var HEAP16 = new Int16Array(buffer); @@ -50,6 +49,7 @@ function asmFunc(importObject) { var Math_sqrt = Math.sqrt; var nan = NaN; var infinity = Infinity; + var env = imports.env; var setTempRet0 = env.setTempRet0; var i64toi32_i32$HIGH_BITS = 0; function $0() { @@ -127,7 +127,7 @@ function asmFunc(importObject) { } var retasmFunc = asmFunc({ - setTempRet0, + "env": env, }); export var i32_load = retasmFunc.i32_load; export var i64_load = retasmFunc.i64_load; -- cgit v1.2.3