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

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