js/src/jit-test/tests/for-of/arrays-growing-2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/for-of/arrays-growing-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,10 @@
     1.4 +// Inserting values in an array does not change the next index of an existing iterator.
     1.5 +
     1.6 +var a = [1, 2, 3, 4];
     1.7 +var s = '';
     1.8 +for (var v of a) {
     1.9 +    s += v;
    1.10 +    if (s.length === 2)
    1.11 +        a.unshift('x');
    1.12 +}
    1.13 +assertEq(s, '12234');

mercurial