mirror of
https://github.com/denoland/deno.git
synced 2024-10-30 09:08:00 -04:00
22 lines
482 B
TypeScript
22 lines
482 B
TypeScript
|
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);
|