const-outer-inner-let-bindings.js (516B)
1 // Copyright (C) 2011 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.1 5 description: > 6 outer const binding unchanged by for-loop const binding 7 ---*/ 8 // 9 10 const x = "outer_x"; 11 const y = "outer_y"; 12 var i = 0; 13 14 for (const x = "inner_x"; i < 1; i++) { 15 const y = "inner_y"; 16 17 assert.sameValue(x, "inner_x"); 18 assert.sameValue(y, "inner_y"); 19 } 20 assert.sameValue(x, "outer_x"); 21 assert.sameValue(y, "outer_y"); 22 23 24 reportCompare(0, 0);