Skip to content

Commit

Permalink
doc: update the deprecation for exit code to clarify its scope
Browse files Browse the repository at this point in the history
This updates the deprecation, DEP0164, to clarify its scope.

Previously, `process.exitCode` wasn't mentioned but it needs
to be applied with the same deprecation because its meaning
is the same as the `code` value and it's overridden with the
`code` value in `process.exit()`.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #44714
Refs: #44712
Refs: #43738
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
daeyeon and aduh95 authored Sep 24, 2022
1 parent 7e0097d commit abfeed8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3171,21 +3171,27 @@ Use [`diagnostics_channel.subscribe(name, onMessage)`][] or
[`diagnostics_channel.unsubscribe(name, onMessage)`][] which does the same
thing instead.

### DEP0164: `process.exit([code])` coercion to integer
### DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44714
description: Documentation-only deprecation of `process.exitCode` integer
coercion.
- version:
- v18.7.0
- v16.17.0
pr-url: https://github.com/nodejs/node/pull/43738
description: Documentation-only deprecation.
description: Documentation-only deprecation of `process.exit(code)` integer
coercion.
-->

Type: Documentation-only

`code` values other than `undefined`, `null`, integer numbers and integer
strings (e.g., '1') are deprecated as parameter in [`process.exit()`][].
Values other than `undefined`, `null`, integer numbers, and integer strings
(e.g., `'1'`) are deprecated as value for the `code` parameter in
[`process.exit()`][] and as value to assign to [`process.exitCode`][].

### DEP0165: `--trace-atomics-wait`

Expand Down Expand Up @@ -3341,6 +3347,7 @@ Node-API callbacks.
[`os.tmpdir()`]: os.md#ostmpdir
[`process.env`]: process.md#processenv
[`process.exit()`]: process.md#processexitcode
[`process.exitCode`]: process.md#processexitcode_1
[`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo
[`process.mainModule`]: process.md#processmainmodule
[`punycode`]: punycode.md
Expand Down

0 comments on commit abfeed8

Please sign in to comment.