diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-06-11 15:03:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 11:03:27 -0400 |
commit | 813210d4337bf6e174f1da1f1a6c6fb9b073afa2 (patch) | |
tree | fa408a74ced787b2864dbfec524c1ea6588fde00 /cli/tests/wasm_unreachable.js | |
parent | 5ee2ce1b1c37f08b11a25e6c0d190f3c397c7ec2 (diff) |
fix: WebAssembly runtime error propagation (#6137)
Currently WebAssembly runtime errors don't propagate up to the user as
they use urls to denote where the error occurred which get caught by the source-map
pipeline which doesn't support the wasm scheme.
Diffstat (limited to 'cli/tests/wasm_unreachable.js')
-rw-r--r-- | cli/tests/wasm_unreachable.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/cli/tests/wasm_unreachable.js b/cli/tests/wasm_unreachable.js new file mode 100644 index 000000000..991ebcec8 --- /dev/null +++ b/cli/tests/wasm_unreachable.js @@ -0,0 +1,50 @@ +// WebAssembly module containing a single function with an unreachable instruction +const binary = Uint8Array.from([ + 0x00, + 0x61, + 0x73, + 0x6d, + 0x01, + 0x00, + 0x00, + 0x00, + 0x01, + 0x04, + 0x01, + 0x60, + 0x00, + 0x00, + 0x03, + 0x02, + 0x01, + 0x00, + 0x07, + 0x0f, + 0x01, + 0x0b, + 0x75, + 0x6e, + 0x72, + 0x65, + 0x61, + 0x63, + 0x68, + 0x61, + 0x62, + 0x6c, + 0x65, + 0x00, + 0x00, + 0x0a, + 0x05, + 0x01, + 0x03, + 0x00, + 0x00, + 0x0b, +]); + +const module = new WebAssembly.Module(binary); +const instance = new WebAssembly.Instance(module); + +instance.exports.unreachable(); |