mirror of https://github.com/tc39/test262.git
Assert error when invoking RegExp source getter on cross-realm RegExp.prototype
RegExp.prototype is not a RegExp, and the algorithm only special-cases (same-realm) %RegExpPrototype%.
This commit is contained in:
parent
be4c8a5c4e
commit
823af01575
|
@ -13,6 +13,8 @@ info: |
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source').get;
|
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source').get;
|
||||||
|
var otherRealm = $262.createRealm().global;
|
||||||
|
var otherRealmRegExpProto = otherRealm.RegExp.prototype;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
get.call({});
|
get.call({});
|
||||||
|
@ -25,3 +27,7 @@ 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(otherRealmRegExpProto);
|
||||||
|
}, 'cross-realm RegExp.prototype');
|
||||||
|
|
Loading…
Reference in New Issue