mirror of
https://github.com/tc39/test262.git
synced 2025-07-22 13:34:38 +02:00
Assert error when invoking any %RegExpPrototype%-aware getter on cross-realm RegExp.prototype
This commit is contained in:
parent
9e0410814a
commit
6da621f161
@ -16,6 +16,9 @@ features: [regexp-dotall]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var dotAll = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll').get;
|
var dotAll = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll').get;
|
||||||
|
var other = $262.createRealm().global;
|
||||||
|
var otherRegExpProto = other.RegExp.prototype;
|
||||||
|
var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'dotAll').get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call({});
|
dotAll.call({});
|
||||||
@ -28,3 +31,11 @@ assert.throws(TypeError, function() {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call(arguments);
|
dotAll.call(arguments);
|
||||||
}, 'arguments object');
|
}, 'arguments object');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
dotAll.call(otherRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
||||||
|
assert.throws(other.TypeError, function() {
|
||||||
|
otherRegExpGetter.call(RegExp.prototype);
|
||||||
|
}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype');
|
||||||
|
@ -13,6 +13,9 @@ info: |
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global').get;
|
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global').get;
|
||||||
|
var other = $262.createRealm().global;
|
||||||
|
var otherRegExpProto = other.RegExp.prototype;
|
||||||
|
var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'global').get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call({});
|
get.call({});
|
||||||
@ -25,3 +28,11 @@ assert.throws(TypeError, function() {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call(arguments);
|
get.call(arguments);
|
||||||
}, 'arguments object');
|
}, 'arguments object');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
get.call(otherRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
||||||
|
assert.throws(other.TypeError, function() {
|
||||||
|
otherRegExpGetter.call(RegExp.prototype);
|
||||||
|
}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype');
|
||||||
|
@ -13,6 +13,9 @@ info: |
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase').get;
|
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase').get;
|
||||||
|
var other = $262.createRealm().global;
|
||||||
|
var otherRegExpProto = other.RegExp.prototype;
|
||||||
|
var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'ignoreCase').get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call({});
|
get.call({});
|
||||||
@ -25,3 +28,11 @@ assert.throws(TypeError, function() {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call(arguments);
|
get.call(arguments);
|
||||||
}, 'arguments object');
|
}, 'arguments object');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
get.call(otherRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
||||||
|
assert.throws(other.TypeError, function() {
|
||||||
|
otherRegExpGetter.call(RegExp.prototype);
|
||||||
|
}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype');
|
||||||
|
@ -13,6 +13,9 @@ info: |
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline').get;
|
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline').get;
|
||||||
|
var other = $262.createRealm().global;
|
||||||
|
var otherRegExpProto = other.RegExp.prototype;
|
||||||
|
var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'multiline').get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call({});
|
get.call({});
|
||||||
@ -25,3 +28,11 @@ assert.throws(TypeError, function() {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call(arguments);
|
get.call(arguments);
|
||||||
}, 'arguments object');
|
}, 'arguments object');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
get.call(otherRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
||||||
|
assert.throws(other.TypeError, function() {
|
||||||
|
otherRegExpGetter.call(RegExp.prototype);
|
||||||
|
}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype');
|
||||||
|
@ -14,6 +14,9 @@ info: |
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var sticky = Object.getOwnPropertyDescriptor(RegExp.prototype, 'sticky').get;
|
var sticky = Object.getOwnPropertyDescriptor(RegExp.prototype, 'sticky').get;
|
||||||
|
var other = $262.createRealm().global;
|
||||||
|
var otherRegExpProto = other.RegExp.prototype;
|
||||||
|
var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'sticky').get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
sticky.call({});
|
sticky.call({});
|
||||||
@ -26,3 +29,11 @@ assert.throws(TypeError, function() {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
sticky.call(arguments);
|
sticky.call(arguments);
|
||||||
}, 'arguments object');
|
}, 'arguments object');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
sticky.call(otherRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
||||||
|
assert.throws(other.TypeError, function() {
|
||||||
|
otherRegExpGetter.call(RegExp.prototype);
|
||||||
|
}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype');
|
||||||
|
@ -14,6 +14,9 @@ info: |
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var unicode = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode').get;
|
var unicode = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode').get;
|
||||||
|
var other = $262.createRealm().global;
|
||||||
|
var otherRegExpProto = other.RegExp.prototype;
|
||||||
|
var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'unicode').get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
unicode.call({});
|
unicode.call({});
|
||||||
@ -26,3 +29,11 @@ assert.throws(TypeError, function() {
|
|||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
unicode.call(arguments);
|
unicode.call(arguments);
|
||||||
}, 'arguments object');
|
}, 'arguments object');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
unicode.call(otherRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
||||||
|
assert.throws(other.TypeError, function() {
|
||||||
|
otherRegExpGetter.call(RegExp.prototype);
|
||||||
|
}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user