[ts] Allow modifiers as names of methods with type parameters (#12356)

This commit is contained in:
Sosuke Suzuki
2020-11-18 23:29:02 +09:00
committed by GitHub
parent e8457ea5d3
commit 94d116052f
12 changed files with 668 additions and 11 deletions

View File

@@ -159,13 +159,13 @@ export default (superClass: Class<Parser>): Class<Parser> =>
// TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...
this.next();
return (
!this.hasPrecedingLineBreak() &&
!this.match(tt.parenL) &&
!this.match(tt.parenR) &&
!this.match(tt.colon) &&
!this.match(tt.eq) &&
!this.match(tt.question) &&
!this.match(tt.bang)
(this.match(tt.bracketL) ||
this.match(tt.braceL) ||
this.match(tt.star) ||
this.match(tt.ellipsis) ||
this.match(tt.hash) ||
this.isLiteralPropertyName()) &&
!this.hasPrecedingLineBreak()
);
}