michael@0: // Changing arguments.length during a for-of loop iterating over arguments affects the loop. michael@0: michael@0: load(libdir + "iteration.js"); michael@0: michael@0: Object.prototype[std_iterator] = Array.prototype[std_iterator]; michael@0: michael@0: var s; michael@0: function f() { michael@0: for (var v of arguments) { michael@0: s += v; michael@0: arguments.length--; michael@0: } michael@0: } michael@0: michael@0: s = ''; michael@0: f('a', 'b', 'c', 'd', 'e'); michael@0: assertEq(s, 'abc');