Files
scriptc/tests/corpus/process-uncaught-sync.cjs
T
Chris Tate e24c8a14dc Preserve native class state and handle terminal process events
- 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:07:31 -05:00

14 lines
531 B
JavaScript

// @no-node-shims
process.once("uncaughtExceptionMonitor", (error, origin) => {
console.log("monitor", error.message, origin);
});
const removed = () => console.log("should not run");
process.on("uncaughtException", removed);
process.off("uncaughtException", removed);
process.once("uncaughtException", (error, origin) => {
console.log("handled", error instanceof Error, error.message, origin);
process.nextTick(() => console.log("handler tick"));
});
setTimeout(() => console.log("survived"), 10);
throw new Error("entry");