js/src/jit-test/tests/for-of/arguments-7.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:4b4e5b53b35d
1 // Changing arguments.length during a for-of loop iterating over arguments affects the loop.
2
3 load(libdir + "iteration.js");
4
5 Object.prototype[std_iterator] = Array.prototype[std_iterator];
6
7 var s;
8 function f() {
9 for (var v of arguments) {
10 s += v;
11 arguments.length--;
12 }
13 }
14
15 s = '';
16 f('a', 'b', 'c', 'd', 'e');
17 assertEq(s, 'abc');

mercurial