diff options
author | Sam Clegg <sbc@chromium.org> | 2022-09-16 09:33:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-16 09:33:08 -0700 |
commit | d797c751df60aa5731a0cfaed1cc00811a5e273b (patch) | |
tree | cb7357ce0f6cfb25774f8565342909bb3df0210e /test/wasm2js/tee_local.2asm.js | |
parent | 3892b0bbe0aa0e57864e6785e43d33e89d39000b (diff) | |
download | binaryen-d797c751df60aa5731a0cfaed1cc00811a5e273b.tar.gz binaryen-d797c751df60aa5731a0cfaed1cc00811a5e273b.tar.bz2 binaryen-d797c751df60aa5731a0cfaed1cc00811a5e273b.zip |
wasm2js: Don't assume that `env.abort` can always be impored. (#5049)
This import was being injected and then used to implement trapping.
Rather than injecting an import that doesn't exist in the original
module we instead use the existing mechanism to implement this as
an internal helper.
Diffstat (limited to 'test/wasm2js/tee_local.2asm.js')
-rw-r--r-- | test/wasm2js/tee_local.2asm.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/wasm2js/tee_local.2asm.js b/test/wasm2js/tee_local.2asm.js index 0e94a2b6c..8bced1525 100644 --- a/test/wasm2js/tee_local.2asm.js +++ b/test/wasm2js/tee_local.2asm.js @@ -12,7 +12,6 @@ function asmFunc(importObject) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - var abort = env.abort; var nan = NaN; var infinity = Infinity; var setTempRet0 = env.setTempRet0; @@ -328,9 +327,9 @@ function asmFunc(importObject) { }; } -var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); }, - setTempRet0 - }); +var retasmFunc = asmFunc({ + setTempRet0, +}); export var type_local_i32 = retasmFunc.type_local_i32; export var type_local_i64 = retasmFunc.type_local_i64; export var type_local_f32 = retasmFunc.type_local_f32; |