fix(babel-parser): Allow line break before assert return type (#13771)

This commit is contained in:
JuniorTour
2021-09-16 16:24:11 -05:00
committed by GitHub
parent 8fb50429ea
commit da79c90f2a
3 changed files with 187 additions and 5 deletions

View File

@@ -1316,11 +1316,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
tsParseTypePredicateAsserts(): boolean {
if (
!this.match(tt.name) ||
this.state.value !== "asserts" ||
this.hasPrecedingLineBreak()
) {
if (!this.match(tt.name) || this.state.value !== "asserts") {
return false;
}
const containsEsc = this.state.containsEsc;