mirror of
https://github.com/denoland/deno.git
synced 2024-11-01 09:24:20 -04:00
813210d433
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.
50 lines
588 B
JavaScript
50 lines
588 B
JavaScript
// 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();
|