Files
scriptc/tests/corpus/6423-process-exitcode-default.ts
T
Malte UblandClaude Opus 5.5 20ab1c0531 Merge main into opt/bc-node-surface
Resolve the conflicts with main's process.features value, the WebCrypto dynamic types, the NODE_COMPAT_VERSION import and the symbol.declarations API. Renumber this branch's corpus programs to 6420-6429, write the new limitations partial one sentence per line, and regenerate the compatibility outputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 19:02:41 -07:00

11 lines
381 B
TypeScript

// @exit: 2
// The exit status follows process.exitCode when the program ends normally.
function settle(failed: boolean): void {
if (failed) process.exitCode = process.exitCode ?? 2;
}
console.log("start", process.exitCode === undefined);
settle(true);
settle(true);
console.log("code", process.exitCode);
process.on("exit", () => console.log("exiting with", process.exitCode));