Skip to content

Commit

Permalink
Revert "fix: Default export for duplicate names (#15736)"
Browse files Browse the repository at this point in the history
This reverts commit 41dea06.
  • Loading branch information
liuxingbaoyu committed Jul 4, 2023
1 parent dc2cf48 commit e57db32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
12 changes: 5 additions & 7 deletions packages/babel-helper-split-export-declaration/src/index.ts
Expand Up @@ -27,8 +27,6 @@ export default function splitExportDeclaration(
const declaration = exportDeclaration.get("declaration");
const standaloneDeclaration =
declaration.isFunctionDeclaration() || declaration.isClassDeclaration();
const exportExpr =
declaration.isFunctionExpression() || declaration.isClassExpression();

const scope = declaration.isScope()
? declaration.scope.parent
Expand All @@ -43,13 +41,13 @@ export default function splitExportDeclaration(

id = scope.generateUidIdentifier("default");

if (standaloneDeclaration || exportExpr) {
if (
standaloneDeclaration ||
declaration.isFunctionExpression() ||
declaration.isClassExpression()
) {
declaration.node.id = cloneNode(id);
}
} else if (exportExpr && scope.hasBinding(id.name)) {
needBindingRegistration = true;

id = scope.generateUidIdentifier(id.name);
}

const updatedDeclaration = standaloneDeclaration
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit e57db32

Please sign in to comment.