Skip to content

Commit 2502f23

Browse files
daeyeonaduh95
authored andcommitted
doc: update the deprecation for exit code to clarify its scope
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>
1 parent 064543d commit 2502f23

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

doc/api/deprecations.md

+41-13
Original file line numberDiff line numberDiff line change
@@ -2889,12 +2889,15 @@ Prefer [`message.socket`][] over [`message.connection`][].
28892889

28902890
<!-- YAML
28912891
changes:
2892+
- version: REPLACEME
2893+
pr-url: https://github.com/nodejs/node/pull/43627
2894+
description: End-of-Life.
28922895
- version: v16.0.0
28932896
pr-url: https://github.com/nodejs/node/pull/36902
28942897
description: Runtime deprecation.
28952898
-->
28962899

2897-
Type: Runtime
2900+
Type: End-of-Life
28982901

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

30583061
<!-- YAML
30593062
changes:
3060-
- version: v17.5.0
3063+
- version:
3064+
- v17.5.0
3065+
- v16.15.0
30613066
pr-url: https://github.com/nodejs/node/pull/41596
30623067
description: Documentation-only deprecation.
30633068
-->
@@ -3090,7 +3095,9 @@ changes:
30903095
- version: v18.0.0
30913096
pr-url: https://github.com/nodejs/node/pull/41896
30923097
description: Runtime deprecation.
3093-
- version: v17.6.0
3098+
- version:
3099+
- v17.6.0
3100+
- v16.15.0
30943101
pr-url: https://github.com/nodejs/node/pull/41872
30953102
description: Documentation-only deprecation.
30963103
-->
@@ -3104,7 +3111,9 @@ which diminished its usefulness.
31043111

31053112
<!-- YAML
31063113
changes:
3107-
- version: v17.6.0
3114+
- version:
3115+
- v17.6.0
3116+
- v16.15.0
31083117
pr-url: https://github.com/nodejs/node/pull/41587
31093118
description: Documentation-only deprecation.
31103119
-->
@@ -3122,15 +3131,20 @@ resources and not the actual references.
31223131

31233132
<!-- YAML
31243133
changes:
3134+
- version: REPLACEME
3135+
pr-url: https://github.com/nodejs/node/pull/42796
3136+
description: End-of-Life.
31253137
- version: v18.0.0
31263138
pr-url: https://github.com/nodejs/node/pull/42607
31273139
description: Runtime deprecation.
3128-
- version: v17.8.0
3140+
- version:
3141+
- v17.8.0
3142+
- v16.15.0
31293143
pr-url: https://github.com/nodejs/node/pull/42149
31303144
description: Documentation-only deprecation.
31313145
-->
31323146

3133-
Type: Runtime
3147+
Type: End-of-Life
31343148

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

31423156
<!-- YAML
31433157
changes:
3144-
- version: v18.7.0
3158+
- version:
3159+
- v18.7.0
3160+
- v16.17.0
31453161
pr-url: https://github.com/nodejs/node/pull/42714
31463162
description: Documentation-only deprecation.
31473163
-->
@@ -3155,19 +3171,27 @@ Use [`diagnostics_channel.subscribe(name, onMessage)`][] or
31553171
[`diagnostics_channel.unsubscribe(name, onMessage)`][] which does the same
31563172
thing instead.
31573173

3158-
### DEP0164: `process.exit([code])` coercion to integer
3174+
### DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer
31593175

31603176
<!-- YAML
31613177
changes:
3162-
- version: v18.7.0
3178+
- version: REPLACEME
3179+
pr-url: https://github.com/nodejs/node/pull/44714
3180+
description: Documentation-only deprecation of `process.exitCode` integer
3181+
coercion.
3182+
- version:
3183+
- v18.7.0
3184+
- v16.17.0
31633185
pr-url: https://github.com/nodejs/node/pull/43738
3164-
description: Documentation-only deprecation.
3186+
description: Documentation-only deprecation of `process.exit(code)` integer
3187+
coercion.
31653188
-->
31663189

31673190
Type: Documentation-only
31683191

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

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

@@ -3186,13 +3210,16 @@ The [`--trace-atomics-wait`][] flag is deprecated.
31863210

31873211
<!-- YAML
31883212
changes:
3213+
- version: REPLACEME
3214+
pr-url: https://github.com/nodejs/node/pull/44495
3215+
description: Runtime deprecation.
31893216
- version: REPLACEME
31903217
pr-url: https://github.com/nodejs/node/pull/44477
31913218
description: Documentation-only deprecation
31923219
with `--pending-deprecation` support.
31933220
-->
31943221

3195-
Type: Documentation-only (supports [`--pending-deprecation`][])
3222+
Type: Runtime
31963223

31973224
Package imports and exports targets mapping into paths including a double slash
31983225
(of _"/"_ or _"\\"_) are deprecated and will fail with a resolution validation
@@ -3320,6 +3347,7 @@ Node-API callbacks.
33203347
[`os.tmpdir()`]: os.md#ostmpdir
33213348
[`process.env`]: process.md#processenv
33223349
[`process.exit()`]: process.md#processexitcode
3350+
[`process.exitCode`]: process.md#processexitcode_1
33233351
[`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo
33243352
[`process.mainModule`]: process.md#processmainmodule
33253353
[`punycode`]: punycode.md

0 commit comments

Comments
 (0)