summaryrefslogtreecommitdiff
path: root/cli/tests/integration/run_tests.rs
diff options
context:
space:
mode:
authorAndreu Botella <andreu@andreubotella.com>2022-03-22 11:33:29 +0100
committerGitHub <noreply@github.com>2022-03-22 11:33:29 +0100
commit12d28dffc6c8d08e6620751e55d8a382c66443a2 (patch)
tree9ad9058ec93c39d5b8015d80cd88d1fa4abf14bc /cli/tests/integration/run_tests.rs
parentc5792d6d1dcd2fe60e59e836015eac4f05a76039 (diff)
fix(fetch): Fix uncaught rejection panic with `WebAssembly.instantiateStreaming` (#13925)
When an exception is thrown during the processing of streaming WebAssembly, `op_wasm_streaming_abort` is called. This op calls into V8, which synchronously rejects the promise and calls into the promise rejection handler, if applicable. But calling an op borrows the isolate's `JsRuntimeState` for the duration of the op, which means it is borrowed when V8 calls into `promise_reject_callback`, which tries to borrow it again, panicking. This change changes `op_wasm_streaming_abort` from an op to a binding (`Deno.core.abortWasmStreaming`). Although that binding must borrow the `JsRuntimeState` in order to access the `WasmStreamingResource` stored in the `OpTable`, it also takes ownership of that `WasmStreamingResource` instance, which means it can drop any borrows of the `JsRuntimeState` before calling into V8.
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r--cli/tests/integration/run_tests.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index 7c82acbf7..aec17faf0 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -2511,3 +2511,9 @@ itest!(config_not_auto_discovered_for_remote_script {
output_str: Some("ok\n"),
http_server: true,
});
+
+itest!(wasm_streaming_panic_test {
+ args: "run wasm_streaming_panic_test.js",
+ output: "wasm_streaming_panic_test.js.out",
+ exit_code: 1,
+});