Skip to content

Commit 2fdf5af

Browse files
committed
Skip Symbol.ToStringTag test if undefined
1 parent e2b3cf3 commit 2fdf5af

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/node/types.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,14 @@ for (const [ getValue, _method ] of [
5858
[ function() { return new Float64Array(); } ],
5959
[ function() { return new BigInt64Array(); } ],
6060
[ function() { return new BigUint64Array(); } ],
61-
[ function() { return Object.defineProperty(new Uint8Array(),
62-
Symbol.toStringTag,
63-
{ value: 'foo' }); } ],
61+
[ function() {
62+
if (typeof Symbol === 'undefined' || typeof Symbol.toStringTag === 'undefined') {
63+
throw Error();
64+
}
65+
return Object.defineProperty(new Uint8Array(),
66+
Symbol.toStringTag,
67+
{ value: 'foo' });
68+
} ],
6469
[ function() { return new DataView(new ArrayBuffer()); } ],
6570
[ function() { return new SharedArrayBuffer(); } ],
6671
// [ new Proxy({}, {}), 'isProxy' ],

0 commit comments

Comments
 (0)