summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testHolePushing.js
blob: a2316130ea8baa937bab47fc1df4c02aecef18a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function testHolePushing() {
    var a = ["foobar", "baz"];
    for (var i = 0; i < 5; i++)
        a = [, "overwritten", "new"];
    var s = "[";
    for (i = 0; i < a.length; i++) {
        s += (i in a) ? a[i] : "<hole>";
        if (i != a.length - 1)
            s += ",";
    }
    return s + "], " + (0 in a);
}
assertEq(testHolePushing(), "[<hole>,overwritten,new], false");