Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly check for-in and for-of loop for invalid left-hand side (#9768
- Loading branch information
Showing
21 changed files
with
75 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Invalid left-hand side in for-loop (2:5)" | ||
} |
184 changes: 0 additions & 184 deletions
184
packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:17)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:15)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "for-in initializer in strict mode (2:15)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (2:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
...babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:17)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
...abel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:17)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var a; | ||
for (a = 0 of {}); |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Invalid left-hand side in for-loop (2:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:16)" | ||
} | ||
"throws": "for-of loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:16)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:16)" | ||
} | ||
"throws": "for-of loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/es2018/async-generators/for-await-no-in/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token (2:19)" | ||
} | ||
"throws": "Unexpected token (2:6)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:17)" | ||
} | ||
"throws": "for-of loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:15)" | ||
} | ||
"throws": "for-of loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:15)" | ||
} | ||
"throws": "for-of loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
...-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:17)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
4 changes: 2 additions & 2 deletions
4
...el-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \";\" (1:15)" | ||
} | ||
"throws": "for-in loop variable declaration may not have an initializer (1:5)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters