From 2502f2353dd5002cc22fc11fe4c8f3f0a96e8eb4 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Sat, 24 Sep 2022 21:43:59 +0900 Subject: [PATCH] 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 Co-authored-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/44714 Refs: https://github.com/nodejs/node/pull/44712 Refs: https://github.com/nodejs/node/pull/43738 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: Antoine du Hamel --- doc/api/deprecations.md | 54 +++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 72303a10f2a783..8cc2acf2f8a291 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2889,12 +2889,15 @@ Prefer [`message.socket`][] over [`message.connection`][]. -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 @@ -3057,7 +3060,9 @@ const w = new Writable({ @@ -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. --> @@ -3104,7 +3111,9 @@ which diminished its usefulness. @@ -3122,15 +3131,20 @@ resources and not the actual references. -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()`][], @@ -3141,7 +3155,9 @@ Convert them to primitive strings. @@ -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 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` @@ -3186,13 +3210,16 @@ The [`--trace-atomics-wait`][] flag is deprecated. -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 @@ -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