Skip to content

Commit 20c88bb

Browse files
committed
Only run boxed primitive tests against supported types
1 parent 8b83548 commit 20c88bb

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

test/node/types.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,20 @@ for (const [ getValue, _method ] of [
9292
// Check boxed primitives.
9393
console.log('Testing', 'isBoxedPrimitive');
9494
[
95-
new Boolean(),
96-
new Number(),
97-
new String(),
98-
Object(Symbol()),
99-
Object(BigInt(0))
100-
].forEach((entry) => assert(types.isBoxedPrimitive(entry)));
95+
function() { return new Boolean(); },
96+
function() { return new Number(); },
97+
function() { return new String(); },
98+
function() { return Object(Symbol()); },
99+
function() { return Object(BigInt(0)); }
100+
].forEach((getEntry) => {
101+
let entry;
102+
try {
103+
entry = getEntry();
104+
} catch (e) {
105+
return;
106+
}
107+
assert(types.isBoxedPrimitive(entry))
108+
});
101109

102110
{
103111
assert(!types.isUint8Array({ [Symbol.toStringTag]: 'Uint8Array' }));

0 commit comments

Comments
 (0)