Skip to content

Commit

Permalink
Don't polyfill if evaluation is not confident (#10397)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyzx authored and nicolo-ribaudo committed Sep 5, 2019
1 parent 2e7bea4 commit 5c859b1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
Expand Up @@ -107,7 +107,7 @@ export default function(
if (isNamespaced(path.get("object"))) return;

let evaluatedPropType = object.name;
let propertyName = property.name;
let propertyName = "";
let instanceType = "";

if (node.computed) {
Expand All @@ -119,6 +119,8 @@ export default function(
propertyName = result.value;
}
}
} else {
propertyName = property.name;
}

if (path.scope.getBindingIdentifier(object.name)) {
Expand Down
@@ -0,0 +1,5 @@
Object['values'](); // include
[]['map'](); // include

Object[keys](); // don't include
[][filter](); // don't include
@@ -0,0 +1,12 @@
{
"presets": [
[
"../../../../lib",
{
"useBuiltIns": "usage",
"corejs": 2,
"modules": false
}
]
]
}
@@ -0,0 +1,13 @@
import "core-js/modules/es6.array.map";
import "core-js/modules/web.dom.iterable";
import "core-js/modules/es6.array.iterator";
import "core-js/modules/es6.object.to-string";
import "core-js/modules/es7.object.values";
Object['values'](); // include

[]['map'](); // include

Object[keys](); // don't include

[][filter](); // don't include

0 comments on commit 5c859b1

Please sign in to comment.