0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00
denoland-deno/cli/tests/testdata/unhandled_rejection.js.out
Bartek Iwańczuk 1a7259b04b
feat: add "unhandledrejection" event support (#12994) (#15080)
Relanding #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 <cjihrig@gmail.com>
2022-07-14 22:39:20 +02:00

8 lines
454 B
Text

unhandled rejection at: Promise {
<rejected> Error: bar not available
at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.js:7:29)
at file:///[WILDCARD]/testdata/unhandled_rejection.js:10:1
} reason: Error: bar not available
at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.js:7:29)
at file:///[WILDCARD]/testdata/unhandled_rejection.js:10:1
unhandled rejection at: Promise { <rejected> undefined } reason: undefined