michael@0: // for-of can iterate arguments objects. michael@0: michael@0: load(libdir + "iteration.js"); michael@0: michael@0: // Arguments objects do not have a .@@iterator() method by default. michael@0: // Install one on Object.prototype. michael@0: Object.prototype[std_iterator] = Array.prototype[std_iterator]; michael@0: michael@0: var s; michael@0: function test() { michael@0: for (var v of arguments) michael@0: s += v; michael@0: } michael@0: michael@0: s = ''; michael@0: test(); michael@0: assertEq(s, ''); michael@0: michael@0: s = ''; michael@0: test('x', 'y'); michael@0: assertEq(s, 'xy');