blob: bc7f2f7995bebaf548e4799b7b602b9b1f13b3b7 [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${actual}`);
}
for (var i = -1e4; i < 1e4; ++i)
shouldBe(isFinite(i), true);
// Emit DoubleRep.
for (var i = 0; i < 1e4; ++i) {
shouldBe(isFinite(Infinity), false);
shouldBe(isFinite(-Infinity), false);
shouldBe(isFinite(NaN), false);
}
// Emit ToNumber.
for (var i = 0; i < 1e4; ++i)
shouldBe(isFinite("0"), true);
shouldBe(isFinite("Hello"), false);