From a2632c86b1ddceae588886c7623a86f46e6098d5 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Thu, 30 Sep 2021 19:52:58 +0200 Subject: fix: Don't panic when a worker is closed in the reactions to a wasm operation. (#12270) --- .../testdata/workers/close_in_wasm_reactions.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cli/tests/testdata/workers/close_in_wasm_reactions.js (limited to 'cli/tests/testdata/workers/close_in_wasm_reactions.js') diff --git a/cli/tests/testdata/workers/close_in_wasm_reactions.js b/cli/tests/testdata/workers/close_in_wasm_reactions.js new file mode 100644 index 000000000..abe573108 --- /dev/null +++ b/cli/tests/testdata/workers/close_in_wasm_reactions.js @@ -0,0 +1,21 @@ +// https://github.com/denoland/deno/issues/12263 +// Test for a panic that happens when a worker is closed in the reactions of a +// WASM async operation. + +// The minimum valid wasm module, plus two additional zero bytes. +const buffer = new Uint8Array([ + 0x00, + 0x61, + 0x73, + 0x6D, + 0x01, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +]); +WebAssembly.compile(buffer).catch((err) => { + console.log("Error:", err); + self.close(); +}); -- cgit v1.2.3