Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Fixes #8651 Reviewed By: SamChou19815 Differential Revision: D42187354 fbshipit-source-id: 042aa651ce1f05aaac35d83730f76b55556ee323
- Loading branch information
1 parent
728216e
commit 1d72c1c
Showing
9 changed files
with
167 additions
and
0 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
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 @@ | ||
for (async of []); |
39 changes: 39 additions & 0 deletions
39
src/parser/test/flow/for_of_loops_invalid/for_async_of.tree.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,39 @@ | ||
{ | ||
"errors":[ | ||
{ | ||
"loc":{"source":null,"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, | ||
"message":"Invalid left-hand side in for-of" | ||
} | ||
], | ||
"type":"Program", | ||
"loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, | ||
"range":[0,18], | ||
"body":[ | ||
{ | ||
"type":"ForOfStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, | ||
"range":[0,18], | ||
"left":{ | ||
"type":"Identifier", | ||
"loc":{"source":null,"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, | ||
"range":[5,10], | ||
"name":"async", | ||
"typeAnnotation":null, | ||
"optional":false | ||
}, | ||
"right":{ | ||
"type":"ArrayExpression", | ||
"loc":{"source":null,"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, | ||
"range":[14,16], | ||
"elements":[] | ||
}, | ||
"body":{ | ||
"type":"EmptyStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, | ||
"range":[17,18] | ||
}, | ||
"await":false | ||
} | ||
], | ||
"comments":[] | ||
} |
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 @@ | ||
for (async of => {};;); |
48 changes: 48 additions & 0 deletions
48
src/parser/test/flow/statement/for/for_async_of_arrow.tree.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,48 @@ | ||
{ | ||
"type":"Program", | ||
"loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, | ||
"range":[0,23], | ||
"body":[ | ||
{ | ||
"type":"ForStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, | ||
"range":[0,23], | ||
"init":{ | ||
"type":"ArrowFunctionExpression", | ||
"loc":{"source":null,"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, | ||
"range":[5,19], | ||
"id":null, | ||
"params":[ | ||
{ | ||
"type":"Identifier", | ||
"loc":{"source":null,"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, | ||
"range":[11,13], | ||
"name":"of", | ||
"typeAnnotation":null, | ||
"optional":false | ||
} | ||
], | ||
"body":{ | ||
"type":"BlockStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, | ||
"range":[17,19], | ||
"body":[] | ||
}, | ||
"async":true, | ||
"generator":false, | ||
"predicate":null, | ||
"expression":false, | ||
"returnType":null, | ||
"typeParameters":null | ||
}, | ||
"test":null, | ||
"update":null, | ||
"body":{ | ||
"type":"EmptyStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, | ||
"range":[22,23] | ||
} | ||
} | ||
], | ||
"comments":[] | ||
} |
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 @@ | ||
for ((async) of y); |
35 changes: 35 additions & 0 deletions
35
src/parser/test/flow/statement/for/for_async_of_parens.tree.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,35 @@ | ||
{ | ||
"type":"Program", | ||
"loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, | ||
"range":[0,19], | ||
"body":[ | ||
{ | ||
"type":"ForOfStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, | ||
"range":[0,19], | ||
"left":{ | ||
"type":"Identifier", | ||
"loc":{"source":null,"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, | ||
"range":[6,11], | ||
"name":"async", | ||
"typeAnnotation":null, | ||
"optional":false | ||
}, | ||
"right":{ | ||
"type":"Identifier", | ||
"loc":{"source":null,"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, | ||
"range":[16,17], | ||
"name":"y", | ||
"typeAnnotation":null, | ||
"optional":false | ||
}, | ||
"body":{ | ||
"type":"EmptyStatement", | ||
"loc":{"source":null,"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, | ||
"range":[18,19] | ||
}, | ||
"await":false | ||
} | ||
], | ||
"comments":[] | ||
} |
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