From f7af0b01a59aaac91473e2f920137004d39a310a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 4 Jul 2022 21:14:58 +0200 Subject: feat: add "unhandledrejection" event support (#12994) This commit adds support for "unhandledrejection" event. This event will trigger event listeners registered using: "globalThis.addEventListener("unhandledrejection") "globalThis.onunhandledrejection" This is done by registering a default handler using "Deno.core.setPromiseRejectCallback" that allows to handle rejected promises in JavaScript instead of Rust. This commit will make it possible to polyfill "process.on("unhandledRejection")" in the Node compat layer. Co-authored-by: Colin Ihrig --- cli/tests/integration/run_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 1cd1db0ef..7ac577d02 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2744,3 +2744,8 @@ itest!(followup_dyn_import_resolved { args: "run --unstable --allow-read followup_dyn_import_resolves/main.ts", output: "followup_dyn_import_resolves/main.ts.out", }); + +itest!(unhandled_rejection { + args: "run --allow-read unhandled_rejection.js", + output: "unhandled_rejection.js.out", +}); -- cgit v1.2.3