Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rescan gt/lt token after TsAsExpression is parsed (#11912)
* refactor: move inType checks to flow plugin * polish: replace hardcoded char codes * fix: rescan greater/less token after asExpression is parsed
- Loading branch information
Showing
5 changed files
with
126 additions
and
20 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
2 changes: 2 additions & 0 deletions
2
packages/babel-parser/test/fixtures/typescript/cast/as/input.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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
x as T; | ||
x < y as boolean; // (x < y) as boolean; | ||
x as boolean <= y; // (x as boolean) <= y; | ||
x === 1 as number; // x === (1 as number); | ||
x as any as T; | ||
x as boolean ?? y; // (x as boolean) ?? y; |
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