From ba5529d9267942bd27763c95e79533b1602efd6e Mon Sep 17 00:00:00 2001 From: Dmitriy Kubyshkin Date: Fri, 17 Jun 2022 04:24:51 +0200 Subject: [PATCH] Fix wrong error for a lexical redeclaration test (#3575) The test as originally specified fails in all compatible parsers, but for the wrong reason. Below is an excerpt from V8, but all parser I tested behave the same: ```js for (const x; false; ) { ^ SyntaxError: Missing initializer in const declaration ``` After the change the error is the assumed: ```js var x; ^ SyntaxError: Identifier 'x' has already been declared ``` --- test/language/statements/for/head-const-bound-names-in-stmt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/language/statements/for/head-const-bound-names-in-stmt.js b/test/language/statements/for/head-const-bound-names-in-stmt.js index e1eeb9fbc6..664b362337 100644 --- a/test/language/statements/for/head-const-bound-names-in-stmt.js +++ b/test/language/statements/for/head-const-bound-names-in-stmt.js @@ -17,6 +17,6 @@ es6id: 13.7.4 $DONOTEVALUATE(); -for (const x; false; ) { +for (const x = 0; false; ) { var x; }