arguments-mapped.js (601B)
1 // Copyright (C) 2014 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 13.6.4 5 description: Mapped arguments object traversal using for..of 6 info: | 7 "Mapped" arguments objects should be able to be traversed using a `for..of` 8 loop. 9 flags: [noStrict] 10 ---*/ 11 12 var i = 0; 13 14 (function() { 15 for (var value of arguments) { 16 assert.sameValue(value, arguments[i], 'argument at index ' + i); 17 i++; 18 } 19 }(0, 'a', true, false, null, undefined, NaN)); 20 21 assert.sameValue(i, 7, 'Visits all arguments'); 22 23 reportCompare(0, 0);