-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Has PRarea: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current Behavior
In #10527, it wasn't taken into account that the asserts keyword can be followed by this, not only by an identifier. Now it's a parser error, Unexpected token. Babel REPL.
Input Code
class Test {
assertIsTest2(): asserts this is Test2 {
if (this instanceof Test2) return;
throw new Error();
}
}Expected behavior/code
Should parse. TypeScript playground.
Environment
- Babel version(s): 7.7.0
- How you are using Babel: @babel/parser
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRarea: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue