Skip to content

Commit

Permalink
refactor: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 25, 2020
1 parent 12eb77b commit bef24ba
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions packages/babel-helper-member-expression-to-functions/src/index.js
Expand Up @@ -190,22 +190,6 @@ const handle = {
current = parentPath;
}

let context;
const endParentPath = endPath.parentPath;
if (
t.isMemberExpression(regular) &&
endParentPath.isOptionalCallExpression({
callee: endPath.node,
optional: true,
})
) {
const { object } = regular;
context = member.scope.maybeGenerateMemoised(object);
if (context) {
regular.object = t.assignmentExpression("=", context, object);
}
}

endPath.replaceWith(
t.conditionalExpression(
t.logicalExpression(
Expand All @@ -224,22 +208,6 @@ const handle = {
),
);

if (context) {
const endParent = endParentPath.node;
endParentPath.replaceWith(
t.optionalCallExpression(
t.optionalMemberExpression(
endParent.callee,
t.identifier("call"),
endParent.computed,
true,
),
[context, ...endParent.arguments],
false,
),
);
}

return;
}

Expand Down

0 comments on commit bef24ba

Please sign in to comment.