summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/arrays-growing-2.js
blob: e9867714ce9d6b76017056c1d92bc186894cc544 (plain)
1
2
3
4
5
6
7
8
9
10
// Inserting values in an array does not change the next index of an existing iterator.

var a = [1, 2, 3, 4];
var s = '';
for (var v of a) {
    s += v;
    if (s.length === 2)
        a.unshift('x');
}
assertEq(s, '12234');