summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testNativeMax.js
blob: ef36dbe5c60f6756fa0c9b1f610006fda1701d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function testNativeMax() {
    var out = [], k;
    for (var i = 0; i < 5; ++i) {
        k = Math.max(k, i);
    }
    out.push(k);

    k = 0;
    for (var i = 0; i < 5; ++i) {
        k = Math.max(k, i);
    }
    out.push(k);

    for (var i = 0; i < 5; ++i) {
        k = Math.max(0, -0);
    }
    out.push((1 / k) < 0);
    return out.join(",");
}
assertEq(testNativeMax(), "NaN,4,false");