Skip to content

Commit

Permalink
refactor: remove unused branch
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 25, 2020
1 parent bb13a71 commit 8bbd608
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions packages/babel-plugin-transform-modules-systemjs/src/index.js
Expand Up @@ -390,26 +390,16 @@ export default declare((api, options) => {

for (const specifier of specifiers) {
const binding = scope.getBinding(specifier.local.name);
if (binding) {
// hoisted function export
const bindingPath = binding.path;
if (bindingPath.isFunctionDeclaration()) {
exportNames.push(specifier.exported.name);
exportValues.push(t.cloneNode(specifier.local));
} else {
// the exportNames will be later added in hoistVariables
addExportName(
specifier.local.name,
specifier.exported.name,
);
}
// hoisted function export
const bindingPath = binding.path;
if (bindingPath.isFunctionDeclaration()) {
exportNames.push(specifier.exported.name);
exportValues.push(t.cloneNode(specifier.local));
} else {
// only globals also exported this way
nodes.push(
buildExportCall(
specifier.exported.name,
specifier.local,
),
// the exportNames will be later added in hoistVariables
addExportName(
specifier.local.name,
specifier.exported.name,
);
}
}
Expand Down

0 comments on commit 8bbd608

Please sign in to comment.