mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
57541b48ba
Fixes several tests blocking https://github.com/denoland/deno/pull/25213 by replacing `window` global that is gone in Deno 2 with `globalThis`. Also adjusted a few tests using deprecated `rid` field.
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
globalThis.addEventListener("unhandledrejection", (event) => {
|
|
console.log("unhandledrejection", event.reason, event.promise);
|
|
event.preventDefault();
|
|
});
|
|
|
|
globalThis.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");
|
|
}, 1000);
|