diff --git a/packages/babel-plugin-inject-polyfills/src/index.js b/packages/babel-plugin-inject-polyfills/src/index.js index 3ab900ff..180f61e2 100644 --- a/packages/babel-plugin-inject-polyfills/src/index.js +++ b/packages/babel-plugin-inject-polyfills/src/index.js @@ -201,7 +201,11 @@ export default declare((api, options: Options, dirname: string) => { const key = resolveKey(path.get("property"), path.node.computed); if (!key || key === "prototype") return; - const source = resolveSource(path.get("object")); + const object = path.get("object"); + const binding = object.scope.getBinding(object.node.name); + if (binding && binding.path.isImportNamespaceSpecifier()) return; + + const source = resolveSource(object); return property(source.id, key, source.placement, path); }, diff --git a/packages/babel-polyfill-provider-corejs3/src/index.js b/packages/babel-polyfill-provider-corejs3/src/index.js index 1c54a1bf..34118a0b 100644 --- a/packages/babel-polyfill-provider-corejs3/src/index.js +++ b/packages/babel-polyfill-provider-corejs3/src/index.js @@ -119,15 +119,6 @@ export default (( }, usagePure(meta, utils, path) { - const isNamespaced = path => { - if (!path.node) return false; - const binding = path.scope.getBinding(path.node.name); - if (!binding) return false; - return binding.path.isImportNamespaceSpecifier(); - }; - - if (isNamespaced(path.get("object"))) return false; - if (meta.kind === "in") { if (meta.key === "Symbol.iterator") { path.replaceWith(