Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd80430

Browse filesBrowse 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
Copy full SHA for fd80430

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎lib/internal/errors.js‎

Copy file name to clipboardExpand all lines: lib/internal/errors.js
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.