File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export default process.env.NODE_ENV === 'production'
23
23
return true ;
24
24
}
25
25
if ( value ) {
26
- const classTag = constructor ?. prototype ?. [ SYMBOL_TO_STRING_TAG ] ;
26
+ const proto = constructor && constructor . prototype ;
27
+ const classTag = proto && proto [ SYMBOL_TO_STRING_TAG ] ;
27
28
const className = classTag || constructor . name ;
28
29
// When the constructor class defines a Symbol.toStringTag
29
30
// property, as most classes exported by graphql-js do, use it
@@ -38,7 +39,7 @@ export default process.env.NODE_ENV === 'production'
38
39
// value is legitimately _not_ instanceof constructor.
39
40
const valueName = classTag
40
41
? value [ SYMBOL_TO_STRING_TAG ]
41
- : value . constructor ? .name ;
42
+ : value . constructor && value . constructor . name ;
42
43
if ( typeof className === 'string' && valueName === className ) {
43
44
throw new Error (
44
45
`Cannot use ${ className } "${ value } " from another module or realm.
You can’t perform that action at this time.
0 commit comments