Skip to content
Snippets Groups Projects
Commit 823af015 authored by Richard Gibson's avatar Richard Gibson Committed by Rick Waldron
Browse files

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%.
parent be4c8a5c
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ info: | ...@@ -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() { ...@@ -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');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment