From 8bbd60806f87ea0026aa0b4d8ab6608507231840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 25 Sep 2020 16:49:27 -0400 Subject: [PATCH] refactor: remove unused branch --- .../src/index.js | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/packages/babel-plugin-transform-modules-systemjs/src/index.js b/packages/babel-plugin-transform-modules-systemjs/src/index.js index d551c2f9510f..947d56031009 100644 --- a/packages/babel-plugin-transform-modules-systemjs/src/index.js +++ b/packages/babel-plugin-transform-modules-systemjs/src/index.js @@ -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, ); } }