-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of methods and fields named "declare" (#575)
Fixes #545 When originally porting babel/babel#11146, there was a mistake where we were using `eatContextual` when actually it was important to use `tsParseModifier`, since `tsParseModifier` won't eat a name token if the following token indicates that it must be the name of a method or field. This PR fixes that by switching to `tsParseModifier` as Babel does. It might be good to later refactor/simplify `tsParseModifier` if the keyword specificity is just for error handling (and to maybe avoid the snapshot/restore), but that can be a follow-up.
- Loading branch information
1 parent
18709a7
commit b3190e2
Showing
2 changed files
with
40 additions
and
8 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