summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/isArray.js
blob: 1c9ff2810ccc3cc22de029e00898b65909d63225 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function f() {
    assertEq(Array.isArray(10), false);
    assertEq(Array.isArray([]), true);
    assertEq(Array.isArray(Math), false);

    var objs = [{}, []];
    for (var i=0; i<objs.length; i++)
        assertEq(Array.isArray(objs[i]), i === 1);
    var arr = [[], [], 1];
    for (var i=0; i<arr.length; i++)
        assertEq(Array.isArray(arr[i]), i < 2);
}
f();
f();
f();