Skip to content

Commit

Permalink
Corresponding change in typescript's checkCommaAfterRest.
Browse files Browse the repository at this point in the history
Reviewed by @tolmasky.
  • Loading branch information
tolmasky committed Jan 14, 2022
1 parent f9d7d96 commit 3b29841
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -3161,15 +3161,16 @@ export default (superClass: Class<Parser>): Class<Parser> =>
return super.parseMaybeDecoratorArguments(expr);
}

checkCommaAfterRest(close) {
checkCommaAfterRest(close): boolean {
if (
this.state.isAmbientContext &&
this.match(tt.comma) &&
this.lookaheadCharCode() === close
) {
this.next();
return false;
} else {
super.checkCommaAfterRest(close);
return super.checkCommaAfterRest(close);
}
}

Expand Down

0 comments on commit 3b29841

Please sign in to comment.