Files
scriptc/tests/corpus/process-uncaught-rejection.cjs
Chris Tate 13718c7ac1 Preserve native class state and handle terminal process events (#571)
- Preserve fields, accessors, added properties, and cyclic references across untyped class boundaries.
- Support platform signal names and native exception handlers that resume queued work.
2026-09-29 09:09:34 -05:00

9 lines
511 B
JavaScript

process.once("uncaughtExceptionMonitor", (error, origin) => console.log("monitor", error.message, origin));
process.once("uncaughtException", (error, origin) => {
console.log("handled rejection", error.message, origin);
process.once("unhandledRejection", () => { throw new Error("listener"); });
process.once("uncaughtException", (error, origin) => console.log("handled listener", error.message, origin));
setTimeout(() => Promise.reject(new Error("next")), 10);
});
Promise.reject(new Error("first"));