summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/in.js
blob: a179d60ecb291e8ab92946d74fa75ddcb88dde3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function f(arr, b) {
    var res = "";
    var a;
    if (b)
        a = arr;
    for (var i=100; i>-200; i--) {
        if (i in a) {
            res += i;
        }
    }
    return res;
}

assertEq(f([1, , 2, 3], true), "320");

try {
    f([1, , 2, 3], false);
    assertEq(0, 1);
} catch(e) {
    assertEq(e instanceof TypeError, true);
}