head-const-bound-names-in-stmt.js (639B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 description: The body may not re-declare variables declared in the head 6 info: | 7 IterationStatement : 8 for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement 9 10 It is a Syntax Error if any element of the BoundNames of LexicalDeclaration 11 also occurs in the VarDeclaredNames of Statement. 12 negative: 13 phase: parse 14 type: SyntaxError 15 esid: sec-for-statement 16 es6id: 13.7.4 17 ---*/ 18 19 $DONOTEVALUATE(); 20 21 for (const x = 0; false; ) { 22 var x; 23 }