Files
scriptc/tests/corpus/1445-exit-process-exit.ts
T
2026-07-22 18:08:04 -05:00

11 lines
411 B
TypeScript

// @exit: 3
// process.exit() runs the 'exit' listeners too (Node's contract), with
// the REAL code, before the teardown-free exit — and nothing after the
// exit call runs. The cursor-restore pattern this exists for
// (audio-preview's process.once("exit", restore)) is exactly this shape.
process.once("exit", (code) => {
console.log("restore at", code);
});
console.log("before exit");
process.exit(3);