@babel/helper-define-polyfill-provider
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -33,7 +33,9 @@ "use strict"; | ||
} | ||
const { | ||
deopt | ||
} = path.evaluate(); | ||
if (deopt && deopt.isIdentifier()) { | ||
return deopt.node.name; | ||
if (path.isPure()) { | ||
const { | ||
deopt | ||
} = path.evaluate(); | ||
if (deopt && deopt.isIdentifier()) { | ||
return deopt.node.name; | ||
} | ||
} | ||
@@ -56,3 +58,3 @@ } | ||
} | ||
if (!isIdentifier || scope.hasBinding(path.node.name, /* noGlobals */true)) { | ||
if (isIdentifier ? scope.hasBinding(path.node.name, /* noGlobals */true) : path.isPure()) { | ||
const { | ||
@@ -87,12 +89,4 @@ value | ||
} | ||
const { | ||
value | ||
} = obj.evaluate(); | ||
if (value !== undefined) { | ||
if (obj.isRegExpLiteral()) { | ||
return { | ||
id: getType(value), | ||
placement: "prototype" | ||
}; | ||
} else if (obj.isRegExpLiteral()) { | ||
return { | ||
id: "RegExp", | ||
@@ -106,2 +100,12 @@ placement: "prototype" | ||
}; | ||
} else if (obj.isPure()) { | ||
const { | ||
value | ||
} = obj.evaluate(); | ||
if (value !== undefined) { | ||
return { | ||
id: getType(value), | ||
placement: "prototype" | ||
}; | ||
} | ||
} | ||
@@ -108,0 +112,0 @@ return { |
{ | ||
"name": "@babel/helper-define-polyfill-provider", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Babel helper to create your own polyfill provider", | ||
@@ -58,3 +58,3 @@ "repository": { | ||
}, | ||
"gitHead": "0e8cfb85899c8fb01728199d81fd37108e1668ab" | ||
"gitHead": "66a6819f44a57152798cb3b0a9272c65752bae86" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
202343
2375