blob: 438b21660da0201bdb7af5f1131231fb4f4b5553 [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
function test1(value)
{
return Number(value) <= 42;
}
noInline(test1);
// Int32.
for (var i = 0; i < 1e4; ++i)
shouldBe(test1(42), true);
// Doubles.
for (var i = 0; i < 1e4; ++i)
shouldBe(test1(42.195), false);
// Non numbers.
for (var i = 0; i < 1e4; ++i)
shouldBe(test1("Hello"), false);