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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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
lettype;
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 ${typeofvalue}`;

0 commit comments

Comments
 (0)