blob: b8129561d213aa253398f7b3f15c0545217c0bdb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Changing arguments.length affects a for-of loop iterating over arguments.
load(libdir + "iteration.js");
Object.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
var s;
function f() {
arguments.length = 2;
for (var v of arguments)
s += v;
}
s = '';
f('a', 'b', 'c', 'd', 'e');
assertEq(s, 'ab');
|