Cleanup object super traversal (#7681)
This commit is contained in:
parent
3f72f1d637
commit
637bfe76b1
@ -25,20 +25,16 @@ export default declare(api => {
|
|||||||
const getObjectRef = () =>
|
const getObjectRef = () =>
|
||||||
(objectRef = objectRef || path.scope.generateUidIdentifier("obj"));
|
(objectRef = objectRef || path.scope.generateUidIdentifier("obj"));
|
||||||
|
|
||||||
path.get("properties").forEach(propertyPath => {
|
path.get("properties").forEach(propPath => {
|
||||||
if (!propertyPath.isMethod()) return;
|
if (!propPath.isMethod()) return;
|
||||||
|
|
||||||
const propPaths: Array = path.get("properties");
|
replacePropertySuper(
|
||||||
for (let propPath of propPaths) {
|
propPath,
|
||||||
if (propPath.isObjectProperty()) propPath = propPath.get("value");
|
propPath.node,
|
||||||
replacePropertySuper(
|
path.scope,
|
||||||
propPath,
|
getObjectRef,
|
||||||
propPath.node,
|
state,
|
||||||
path.scope,
|
);
|
||||||
getObjectRef,
|
|
||||||
state,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (objectRef) {
|
if (objectRef) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user