head-var-bound-names-in-stmt.js (470B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 description: The body may re-declare variables declared in the head 5 esid: sec-for-in-and-for-of-statements-static-semantics-early-errors 6 es6id: 13.7.5 7 ---*/ 8 9 var iterCount = 0; 10 11 for (var x in { attr: null }) { 12 var x; 13 14 assert.sameValue(x, 'attr'); 15 iterCount += 1; 16 } 17 18 assert.sameValue(iterCount, 1); 19 20 reportCompare(0, 0);