Skip to content

Commit fd80430

Browse files
xtx1130danielleadams
authored andcommitted
errors: refactor to use optional chaining
PR-URL: #44184 Reviewed-By: Feng Yu <F3n67u@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Erick Wendel <erick.workspace@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
1 parent bb346ea commit fd80430

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => {
13371337
}, TypeError);
13381338
E('ERR_INVALID_RETURN_PROPERTY_VALUE', (input, name, prop, value) => {
13391339
let type;
1340-
if (value && value.constructor && value.constructor.name) {
1340+
if (value?.constructor?.name) {
13411341
type = `instance of ${value.constructor.name}`;
13421342
} else {
13431343
type = `type ${typeof value}`;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy