mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 06:55:06 +02:00
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.slice);
|
||||||
assert(delete String.prototype.substring);
|
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";
|
var str = "1a2";
|
||||||
|
|
||||||
assert.sameValue(/a/[Symbol.replace](str, "$`b"), "11b2");
|
assert.sameValue(/a/[Symbol.replace](str, "$`b"), "11b2");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user