Skip to content

Commit

Permalink
errors: refactor to use optional chaining
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
xtx1130 authored and ruyadorno committed Aug 22, 2022
1 parent 2ae2828 commit 37a9d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => {
}, TypeError);
E('ERR_INVALID_RETURN_PROPERTY_VALUE', (input, name, prop, value) => {
let type;
if (value && value.constructor && value.constructor.name) {
if (value?.constructor?.name) {
type = `instance of ${value.constructor.name}`;
} else {
type = `type ${typeof value}`;
Expand Down

0 comments on commit 37a9d7a

Please sign in to comment.