summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/inlining/isFiniteInline.js
blob: 6f0897009bcca0cccda76231715abeb80ed9a824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Test inlining of Number.isFinite() */

for (var i = 0; i < 10_000; i++) {
    assertEq(Number.isFinite(NaN), false);
    assertEq(Number.isFinite(-NaN), false);
    assertEq(Number.isFinite(+Infinity), false);
    assertEq(Number.isFinite(-Infinity), false);
    assertEq(Number.isFinite(3), true);
    assertEq(Number.isFinite(3.141592654), true);
    assertEq(Number.isFinite(+0), true);
    assertEq(Number.isFinite(-0), true);
    assertEq(Number.isFinite(-3), true);
    assertEq(Number.isFinite(-3.141592654), true);
    assertEq(Number.isFinite({}), false);
}