Document process.exitCode reads on the limitations page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Malte Ubl
2026-10-19 21:06:01 -07:00
co-authored by Claude Opus 5.5
parent 297ec38f07
commit 72eab2aa0e
@@ -1,3 +1,4 @@
- **Exit status:** Numeric `process.exitCode = value` writes in statement position set the implicit exit status, which `process.exit()` uses when called without an argument.
`process.exit(code)` and `process.exitCode` throw a `RangeError` (`ERR_OUT_OF_RANGE`) for a code that is not a safe integer, and convert other codes to int32, as Node does.
Reads, resets, and assignments used as values are unsupported.
Reading `process.exitCode` answers the assigned code, or `undefined` before any assignment; `process.exit(code)` assigns it before the `'exit'` listeners run.
Resets (`process.exitCode = undefined`) and assignments used as values are unsupported.