From 3e10bbd687c73fe77d433ac1104b281c6c08d7c3 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Sat, 9 Jul 2022 02:05:18 +0900 Subject: [PATCH 1/2] doc: deprecate coercion to integer in process.exit This warns of invalid uses of process.exit([code]) and recommends the correct practice. Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com --- doc/api/deprecations.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 64b577b149a17b..a43391452756cd 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3163,6 +3163,20 @@ 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 + + + +Type: Documentation-only + +Implicit coercion of a non-integer `code` parameter in [`process.exit()`][] is +deprecated. Please use an integer value. + [Legacy URL API]: url.md#legacy-url-api [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 @@ -3241,6 +3255,7 @@ thing instead. [`os.networkInterfaces()`]: os.md#osnetworkinterfaces [`os.tmpdir()`]: os.md#ostmpdir [`process.env`]: process.md#processenv +[`process.exit()`]: process.md#processexitcode [`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo [`process.mainModule`]: process.md#processmainmodule [`punycode`]: punycode.md From 33cb23b2b3256139ce4a3477a1624f767d78b8ff Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Sat, 9 Jul 2022 12:58:48 +0900 Subject: [PATCH 2/2] fixup: allow integer strings Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com --- doc/api/deprecations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index a43391452756cd..b67aec2e1907a3 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3174,8 +3174,8 @@ changes: Type: Documentation-only -Implicit coercion of a non-integer `code` parameter in [`process.exit()`][] is -deprecated. Please use an integer value. +`code` values other than `undefined`, `null`, integer numbers and integer +strings (e.g., '1') are deprecated as parameter in [`process.exit()`][]. [Legacy URL API]: url.md#legacy-url-api [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf