blob: ea69fe5cf333c6efb51d2d5cb92e1ab7445356ed [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
function test(x) {
return Number(x) < 42;
}
noInline(test);
var object = { valueOf() { return 42; } };
for (var i = 0; i < 1e4; ++i)
shouldBe(test(object), false);
// Leave ToNumber for objects.
// And this should update the value profiling to accept doubles in ToNumber calls.
var object = { valueOf() { return 42.195; } };
for (var i = 0; i < 1e4; ++i)
shouldBe(test(object), false);