Skip to content

Commit

Permalink
a first try
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoarrais committed Sep 11, 2019
1 parent 51ea38e commit ec5731f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/babel-polyfill-provider-corejs3/src/index.js
Expand Up @@ -124,6 +124,15 @@ 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(
Expand Down
@@ -0,0 +1,2 @@
import * as bar from "bar";
bar.map();
@@ -0,0 +1,11 @@
{
"plugins": [
[
"@babel/plugin-inject-polyfills",
{
"method": "usage-pure",
"providers": ["@@/corejs3"]
}
]
]
}
@@ -0,0 +1,2 @@
import * as bar from "bar";
bar.map();

0 comments on commit ec5731f

Please sign in to comment.