blob: 4961cca3c7d6ac42771e9964c7a8674b454be11e [file] [log] [blame] [edit]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function test(target)
{
return "OKOK".replace(/OK/g, target);
}
noInline(test);
for (var i = 0; i < testLoopCount; ++i)
shouldBe(test("Replaced"), `ReplacedReplaced`);
RegExp.prototype[Symbol.replace] = function() { return "Hello"; }
shouldBe(test("Replaced"), `Hello`);