mirror of https://github.com/tc39/test262.git
18 lines
337 B
JavaScript
18 lines
337 B
JavaScript
function shouldBe(actual, expected) {
|
|
if (actual !== expected)
|
|
throw new Error('bad value: ' + actual);
|
|
}
|
|
noInline(shouldBe);
|
|
|
|
function test(value)
|
|
{
|
|
return value[2];
|
|
}
|
|
noInline(test);
|
|
|
|
for (var i = 0; i < 1e4; ++i) {
|
|
shouldBe(test("Hello"), 'l');
|
|
shouldBe(test("World"), 'r');
|
|
shouldBe(test("Nice"), 'c');
|
|
}
|