1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 16:49:18 -05:00
denoland-deno/cli/tests/testdata/node/unhandled_rejection_web_process.ts

22 lines
482 B
TypeScript
Raw Normal View History

import chalk from "npm:chalk";
import process from "node:process";
console.log(chalk.red("Hello world!"));
process.on("unhandledRejection", (_e) => {
console.log('process.on("unhandledRejection");');
});
globalThis.addEventListener("unhandledrejection", (_e) => {
console.log('globalThis.addEventListener("unhandledrejection");');
});
// deno-lint-ignore require-await
(async () => {
throw new Error("boom!");
})();
setTimeout(() => {
console.log("Success");
}, 1000);