Don't allow instance properties transformation on namespace (#10372)
This commit is contained in:
@@ -113,7 +113,14 @@ export default declare((api, options, dirname) => {
|
||||
);
|
||||
}
|
||||
|
||||
function isNamespaced(path) {
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return false;
|
||||
return binding.path.isImportNamespaceSpecifier();
|
||||
}
|
||||
|
||||
function maybeNeedsPolyfill(path, methods, name) {
|
||||
if (isNamespaced(path.get("object"))) return false;
|
||||
if (!methods[name].types) return true;
|
||||
|
||||
const typeAnnotation = path.get("object").getTypeAnnotation();
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
import * as bar from "bar";
|
||||
bar.map();
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": [["transform-runtime", { "corejs": 3 }]]
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
import * as bar from "bar";
|
||||
bar.map();
|
||||
Reference in New Issue
Block a user