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
2 people authored and RafaelGSS committed Sep 26, 2022
1 parent 2f99461 commit 2dab3bd
Showing 1 changed file with 41 additions and 13 deletions.
54 changes: 41 additions & 13 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2889,12 +2889,15 @@ Prefer [`message.socket`][] over [`message.connection`][].

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/43627
description: End-of-Life.
- version: v16.0.0
pr-url: https://github.com/nodejs/node/pull/36902
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

The `process.config` property provides access to Node.js compile-time settings.
However, the property is mutable and therefore subject to tampering. The ability
Expand Down Expand Up @@ -3057,7 +3060,9 @@ const w = new Writable({

<!-- YAML
changes:
- version: v17.5.0
- version:
- v17.5.0
- v16.15.0
pr-url: https://github.com/nodejs/node/pull/41596
description: Documentation-only deprecation.
-->
Expand Down Expand Up @@ -3090,7 +3095,9 @@ changes:
- version: v18.0.0
pr-url: https://github.com/nodejs/node/pull/41896
description: Runtime deprecation.
- version: v17.6.0
- version:
- v17.6.0
- v16.15.0
pr-url: https://github.com/nodejs/node/pull/41872
description: Documentation-only deprecation.
-->
Expand All @@ -3104,7 +3111,9 @@ which diminished its usefulness.

<!-- YAML
changes:
- version: v17.6.0
- version:
- v17.6.0
- v16.15.0
pr-url: https://github.com/nodejs/node/pull/41587
description: Documentation-only deprecation.
-->
Expand All @@ -3122,15 +3131,20 @@ resources and not the actual references.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/42796
description: End-of-Life.
- version: v18.0.0
pr-url: https://github.com/nodejs/node/pull/42607
description: Runtime deprecation.
- version: v17.8.0
- version:
- v17.8.0
- v16.15.0
pr-url: https://github.com/nodejs/node/pull/42149
description: Documentation-only deprecation.
-->

Type: Runtime
Type: End-of-Life

Implicit coercion of objects with own `toString` property, passed as second
parameter in [`fs.write()`][], [`fs.writeFile()`][], [`fs.appendFile()`][],
Expand All @@ -3141,7 +3155,9 @@ Convert them to primitive strings.

<!-- YAML
changes:
- version: v18.7.0
- version:
- v18.7.0
- v16.17.0
pr-url: https://github.com/nodejs/node/pull/42714
description: Documentation-only deprecation.
-->
Expand All @@ -3155,19 +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: v18.7.0
- 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 All @@ -3186,13 +3210,16 @@ The [`--trace-atomics-wait`][] flag is deprecated.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44495
description: Runtime deprecation.
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/44477
description: Documentation-only deprecation
with `--pending-deprecation` support.
-->

Type: Documentation-only (supports [`--pending-deprecation`][])
Type: Runtime

Package imports and exports targets mapping into paths including a double slash
(of _"/"_ or _"\\"_) are deprecated and will fail with a resolution validation
Expand Down Expand Up @@ -3320,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 2dab3bd

Please sign in to comment.