blob: 290b1570a5524f95d0b5f578553b02cc7d142c06 [file] [log] [blame] [edit]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function test(string) {
return string.replace("Hello", "$`");
}
noInline(test);
function test2(string) {
return string.replace("Hello", "REPLACE$`REPLACE");
}
noInline(test2);
for (var i = 0; i < testLoopCount; ++i)
shouldBe(test("Hi, Hello World"), `Hi, Hi, World`);
for (var i = 0; i < testLoopCount; ++i)
shouldBe(test2("Hi, Hello World"), `Hi, REPLACEHi, REPLACE World`);