Skip to content

Commit 29eaaa0

Browse files
xtx1130juanarbol
authored andcommitted
errors: refactor to use optional chaining
PR-URL: #44184 Reviewed-By: Feng Yu <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]> Reviewed-By: Erick Wendel <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]>
1 parent e6f3de0 commit 29eaaa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/errors.js

+1-1
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)