Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2021-02-28 22:33:11 +0300
committerMichaël Zasso <targos@protonmail.com>2021-05-01 13:25:17 +0300
commit13d972dd86ccfc4cd99676b54e5a17054dd7f01f (patch)
tree1d2ca4612dd22393e5fb8a596dc126578bd16690 /lib
parent0255ed7e8e02f2ab950f60715e74986bc0400dff (diff)
domain: show falsy names as anonymous for DEP0097
Many anonymous functions use the empty string as their name. Since the DEP0097 logic was using nullish coalescing, these functions were not being displayed as anonymous. This commit updates the logic to use || instead of ??. PR-URL: https://github.com/nodejs/node/pull/37550 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/domain.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/domain.js b/lib/domain.js
index 4a018c52f84..4e6cfcebc3a 100644
--- a/lib/domain.js
+++ b/lib/domain.js
@@ -130,7 +130,7 @@ function emitMakeCallbackDeprecation({ target, method }) {
'Using a domain property in MakeCallback is deprecated. Use the ' +
'async_context variant of MakeCallback or the AsyncResource class ' +
'instead. ' +
- `(Triggered by calling ${method?.name ?? '<anonymous>'} ` +
+ `(Triggered by calling ${method?.name || '<anonymous>'} ` +
`on ${target?.constructor?.name}.)`,
'DeprecationWarning', 'DEP0097');
sendMakeCallbackDeprecation = true;