Cleanup object super traversal (#7681)

This commit is contained in:
Justin Ridgewell
2018-04-06 20:39:57 +01:00
committed by GitHub
parent 3f72f1d637
commit 637bfe76b1

View File

@@ -25,20 +25,16 @@ export default declare(api => {
const getObjectRef = () =>
(objectRef = objectRef || path.scope.generateUidIdentifier("obj"));
path.get("properties").forEach(propertyPath => {
if (!propertyPath.isMethod()) return;
path.get("properties").forEach(propPath => {
if (!propPath.isMethod()) return;
const propPaths: Array = path.get("properties");
for (let propPath of propPaths) {
if (propPath.isObjectProperty()) propPath = propPath.get("value");
replacePropertySuper(
propPath,
propPath.node,
path.scope,
getObjectRef,
state,
);
}
replacePropertySuper(
propPath,
propPath.node,
path.scope,
getObjectRef,
state,
);
});
if (objectRef) {