blob: cc2cca8660cdd528b550dbcd1d1587826e0985d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
function f(x) {
return (+(x || 1) ? 0 : x);
}
// Prevent top-level Ion-compilation, so we don't inline |f|.
with ({});
for (let i = 0; i < 100; ++i) {
assertEq(f(), 0);
}
assertEq(f("not-a-number"), "not-a-number");
|