Add cases to RegExp.prototype flags brand checking tests

For completeness, as we are doing in newer brand checking tests such as
those of Temporal, call these getters with a function object and a bigint
as the receiver.

Suggested in https://github.com/tc39/test262/pull/3614/files#r929662337
This commit is contained in:
Philip Chimento 2022-07-26 10:40:12 -07:00 committed by Philip Chimento
parent 9e51a9d855
commit d45766bef3
17 changed files with 68 additions and 0 deletions

View File

@ -28,3 +28,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
dotAll.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
dotAll.call(() => {});
}, 'function object');

View File

@ -38,3 +38,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
dotAll.call(4);
}, "number");
assert.throws(TypeError, function() {
dotAll.call(4n);
}, "bigint");

View File

@ -35,3 +35,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(Symbol());
}, 'symbol');
assert.throws(TypeError, function() {
get.call(4n);
}, 'bigint');

View File

@ -24,3 +24,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
get.call(() => {});
}, 'function object');

View File

@ -35,3 +35,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(symbol);
}, 'symbol');
assert.throws(TypeError, function() {
get.call(4n);
}, 'bigint');

View File

@ -28,3 +28,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
hasIndices.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
hasIndices.call(() => {});
}, 'function object');

View File

@ -38,3 +38,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
hasIndices.call(4);
}, "number");
assert.throws(TypeError, function() {
hasIndices.call(4n);
}, "bigint");

View File

@ -24,3 +24,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
get.call(() => {});
}, 'function object');

View File

@ -35,3 +35,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(symbol);
}, 'symbol');
assert.throws(TypeError, function() {
get.call(4n);
}, 'bigint');

View File

@ -24,3 +24,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
get.call(() => {});
}, 'function object');

View File

@ -35,3 +35,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(symbol);
}, 'symbol');
assert.throws(TypeError, function() {
get.call(4n);
}, 'bigint');

View File

@ -24,3 +24,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
get.call(() => {});
}, 'function object');

View File

@ -35,3 +35,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
get.call(symbol);
}, 'symbol');
assert.throws(TypeError, function() {
get.call(4n);
}, 'bigint');

View File

@ -26,3 +26,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
sticky.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
sticky.call(() => {});
}, 'function object');

View File

@ -38,3 +38,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
sticky.call(4);
});
assert.throws(TypeError, function() {
sticky.call(4n);
}, 'bigint');

View File

@ -26,3 +26,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
unicode.call(arguments);
}, 'arguments object');
assert.throws(TypeError, function() {
unicode.call(() => {});
}, 'function object');

View File

@ -38,3 +38,7 @@ assert.throws(TypeError, function() {
assert.throws(TypeError, function() {
unicode.call(4);
});
assert.throws(TypeError, function() {
unicode.call(4n);
}, 'bigint');