Skip to content

Commit

Permalink
Apply code review changes
Browse files Browse the repository at this point in the history
Co-Authored-By: Nicol貌 Ribaudo <7000710+nicolo-ribaudo@users.noreply.github.com>
  • Loading branch information
fedeci and nicolo-ribaudo committed Apr 6, 2021
1 parent 264bc6a commit fd7dbcc
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -2780,16 +2780,14 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}

checkCommaAfterRest(close) {
if (this.match(tt.comma)) {
if (this.lookaheadCharCode() === close) {
if (!this.state.isDeclareContext) {
this.raiseTrailingCommaAfterRest(this.state.start);
return;
}
this.eat(tt.comma);
} else {
this.raiseRestNotLast(this.state.start);
}
if (
this.state.isDeclareContext &&
this.match(tt.comma) &&
this.lookaheadCharCode() === close
) {
this.next();
} else {
super.checkCommaAfterRest(close);
}
}

Expand Down

0 comments on commit fd7dbcc

Please sign in to comment.