v3 new release (#84)

swap to graphql
This commit is contained in:
github-actions[bot]
2022-07-11 13:48:02 -04:00
committed by GitHub
parent 20d2b4f98d
commit e4f3964f67
1492 changed files with 63799 additions and 63001 deletions

View File

@ -251,10 +251,11 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);
flatSuperProps.forEach(superProp => {
const key = superProp.node.computed ? "" : superProp.get("property").node.name;
const isAssignment = superProp.parentPath.isAssignmentExpression({
const superParentPath = superProp.parentPath;
const isAssignment = superParentPath.isAssignmentExpression({
left: superProp.node
});
const isCall = superProp.parentPath.isCallExpression({
const isCall = superParentPath.isCallExpression({
callee: superProp.node
});
const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
@ -265,18 +266,18 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
}
if (isAssignment) {
const value = superProp.parentPath.node.right;
const value = superParentPath.node.right;
args.push(value);
}
const call = callExpression(identifier(superBinding), args);
if (isCall) {
superProp.parentPath.unshiftContainer("arguments", thisExpression());
superParentPath.unshiftContainer("arguments", thisExpression());
superProp.replaceWith(memberExpression(call, identifier("call")));
thisPaths.push(superProp.parentPath.get("arguments.0"));
thisPaths.push(superParentPath.get("arguments.0"));
} else if (isAssignment) {
superProp.parentPath.replaceWith(call);
superParentPath.replaceWith(call);
} else {
superProp.replaceWith(call);
}