-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(43879): forbid async in the left hand in a for-of statement
- Loading branch information
1 parent
3e25424
commit 16b17c8
Showing
7 changed files
with
48 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
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,9 @@ | ||
tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement22.ts(2,6): error TS1106: The left-hand side of a for-of statement may not be 'async'. | ||
|
||
|
||
==== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement22.ts (1 errors) ==== | ||
var async; | ||
for (async of [1, 2]) {} | ||
~~~~~ | ||
!!! error TS1106: The left-hand side of a for-of statement may not be 'async'. | ||
|
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,8 @@ | ||
//// [parserForOfStatement22.ts] | ||
var async; | ||
for (async of [1, 2]) {} | ||
|
||
|
||
//// [parserForOfStatement22.js] | ||
var async; | ||
for (async of [1, 2]) { } |
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,7 @@ | ||
=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement22.ts === | ||
var async; | ||
>async : Symbol(async, Decl(parserForOfStatement22.ts, 0, 3)) | ||
|
||
for (async of [1, 2]) {} | ||
>async : Symbol(async, Decl(parserForOfStatement22.ts, 0, 3)) | ||
|
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,10 @@ | ||
=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement22.ts === | ||
var async; | ||
>async : any | ||
|
||
for (async of [1, 2]) {} | ||
>async : any | ||
>[1, 2] : number[] | ||
>1 : 1 | ||
>2 : 2 | ||
|
4 changes: 4 additions & 0 deletions
4
tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement22.ts
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,4 @@ | ||
// @target: esnext | ||
|
||
var async; | ||
for (async of [1, 2]) {} |