mirror of https://github.com/tc39/test262.git
Improve RegExp.prototype[@@replace] poisoned stdlib test
This commit is contained in:
parent
d10446a5e4
commit
323905b70e
|
@ -17,6 +17,17 @@ assert(delete String.prototype.indexOf);
|
|||
assert(delete String.prototype.slice);
|
||||
assert(delete String.prototype.substring);
|
||||
|
||||
for (let i = 0; i < 5; ++i) {
|
||||
Object.defineProperty(Array.prototype, i, {
|
||||
get: function() {
|
||||
throw new Test262Error(i + " getter should be unreachable.");
|
||||
},
|
||||
set: function(_value) {
|
||||
throw new Test262Error(i + " setter should be unreachable.");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
var str = "1a2";
|
||||
|
||||
assert.sameValue(/a/[Symbol.replace](str, "$`b"), "11b2");
|
||||
|
|
Loading…
Reference in New Issue