summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/array-holes-1.js
blob: 3d8612219263d6926dd754829fbf95e708c43fb6 (plain)
1
2
3
4
5
6
7
8
9
10
// for-of does not skip Array holes. The value at a hole is undefined.

var a = [0, , 2, 3];
var log = [];
for (var x of a) {
    assertEq(x, a[log.length]);
    log.push(x);
}
assertEq(log[1], undefined);
assertEq(log.join(), "0,,2,3");