Skip to content

Commit

Permalink
Fix duplicated export error.
Browse files Browse the repository at this point in the history
Reviewed by @tolmasky.
  • Loading branch information
tolmasky committed Mar 7, 2022
1 parent 06f46ab commit 528989c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -3715,7 +3715,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
} else if (tokenIsKeywordOrIdentifier(this.state.type)) {
// { type something ...? }
hasTypeSpecifier = true;
leftOfAs = this.parseIdentifier();
leftOfAs = isImport
? this.parseIdentifier()
: this.parseModuleExportName();
}
if (hasTypeSpecifier && isInTypeOnlyImportExport) {
this.raise(
Expand Down
Expand Up @@ -3,7 +3,6 @@
"start":0,"end":34,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":19,"index":34}},
"errors": [
"SyntaxError: Unexpected keyword 'if'. (1:6)",
"SyntaxError: Unexpected keyword 'if'. (2:14)",
"SyntaxError: Unexpected keyword 'if'. (2:14)"
],
"program": {
Expand Down

0 comments on commit 528989c

Please sign in to comment.