File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ const getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors
77const isBrowser = typeof window !== 'undefined' ;
88
99const bigIntSupported = typeof BigInt !== 'undefined' ;
10+ const symbolSupported = typeof Symbol !== 'undefined' ;
11+ const symbolToStringTagSupported = symbolSupported && typeof Symbol . toStringTag !== 'undefined' ;
1012
1113const noop = ( ) => { } ;
1214
@@ -234,6 +236,7 @@ module.exports = {
234236 getOwnPropertyDescriptors,
235237 isBrowser,
236238 bigIntSupported,
239+ symbolToStringTagSupported,
237240 mustNotCall,
238241 mustCall,
239242 expectWarning,
Original file line number Diff line number Diff line change @@ -1012,7 +1012,7 @@ assert.throws(
10121012}
10131013
10141014// Verify that extra keys will be tested for when using fake arrays.
1015- {
1015+ if ( common . symbolToStringTagSupported ) {
10161016 const a = {
10171017 0 : 1 ,
10181018 1 : 1 ,
@@ -1029,7 +1029,7 @@ assert.throws(
10291029}
10301030
10311031// Verify that changed tags will still check for the error message.
1032- {
1032+ if ( common . symbolToStringTagSupported ) {
10331033 const err = new Error ( 'foo' ) ;
10341034 err [ Symbol . toStringTag ] = 'Foobar' ;
10351035 const err2 = new Error ( 'bar' ) ;
@@ -1038,7 +1038,7 @@ assert.throws(
10381038}
10391039
10401040// Check for non-native errors.
1041- {
1041+ if ( common . symbolToStringTagSupported ) {
10421042 const source = new Error ( 'abc' ) ;
10431043 const err = Object . create (
10441044 Object . getPrototypeOf ( source ) , common . getOwnPropertyDescriptors ( source ) ) ;
You can’t perform that action at this time.
0 commit comments