1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/tests/testdata/run/rejection_handled.ts
Igor Zinkovsky b3d7df5535
perf: v8 code cache (#23081)
This PR enables V8 code cache for ES modules and for `require` scripts
through `op_eval_context`. Code cache artifacts are transparently stored
and fetched using sqlite db and are passed to V8. `--no-code-cache` can
be used to disable.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-04-17 07:19:55 -07:00

17 lines
467 B
TypeScript

window.addEventListener("unhandledrejection", (event) => {
console.log("unhandledrejection", event.reason, event.promise);
event.preventDefault();
});
window.addEventListener("rejectionhandled", (event) => {
console.log("rejectionhandled", event.reason, event.promise);
});
const a = Promise.reject(1);
setTimeout(async () => {
a.catch(() => console.log("Added catch handler to the promise"));
}, 10);
setTimeout(() => {
console.log("Success");
}, 200);