blob: 002b1ce417b3aa155f215d5d3f2878e3881441d8 [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var flag = false;
function test(string) {
if (flag)
return string.codePointAt(0x7fffffff);
return 42;
}
noInline(test);
flag = true;
for (var i = 0; i < 40; ++i) {
shouldBe(test(""), undefined);
}
flag = false;
for (var i = 0; i < 1e6; ++i)
shouldBe(test(""), 42);
flag = true;
for (var i = 0; i < 1e6; ++i)
shouldBe(test(""), undefined);