From 040a7cc3721292669609cc8020bd11ad6930d321 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 5 Nov 2020 16:10:10 -0800 Subject: wasm2js: Remove global dict arguments to asmFunc (#3325) --- test/wasm2js/dot_import.2asm.js | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) (limited to 'test/wasm2js/dot_import.2asm.js') diff --git a/test/wasm2js/dot_import.2asm.js b/test/wasm2js/dot_import.2asm.js index 98c1d0156..dcdd7da07 100644 --- a/test/wasm2js/dot_import.2asm.js +++ b/test/wasm2js/dot_import.2asm.js @@ -1,18 +1,18 @@ import { ba_se } from 'mod.ule'; -function asmFunc(global, env) { - var Math_imul = global.Math.imul; - var Math_fround = global.Math.fround; - var Math_abs = global.Math.abs; - var Math_clz32 = global.Math.clz32; - var Math_min = global.Math.min; - var Math_max = global.Math.max; - var Math_floor = global.Math.floor; - var Math_ceil = global.Math.ceil; - var Math_sqrt = global.Math.sqrt; +function asmFunc(env) { + var Math_imul = Math.imul; + var Math_fround = Math.fround; + var Math_abs = Math.abs; + var Math_clz32 = Math.clz32; + var Math_min = Math.min; + var Math_max = Math.max; + var Math_floor = Math.floor; + var Math_ceil = Math.ceil; + var Math_sqrt = Math.sqrt; var abort = env.abort; - var nan = global.NaN; - var infinity = global.Infinity; + var nan = NaN; + var infinity = Infinity; var base = env.ba_se; function $0() { base(); @@ -23,20 +23,7 @@ function asmFunc(global, env) { }; } -var retasmFunc = asmFunc({ - Math, - Int8Array, - Uint8Array, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array, - NaN, - Infinity - }, { - abort: function() { throw new Error('abort'); }, +var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); }, ba_se }); export var exported = retasmFunc.exported; -- cgit v1.2.3