diff --git a/packages/babel-helper-member-expression-to-functions/src/index.js b/packages/babel-helper-member-expression-to-functions/src/index.js index 48f23fb3bb46..d6668fe78fef 100644 --- a/packages/babel-helper-member-expression-to-functions/src/index.js +++ b/packages/babel-helper-member-expression-to-functions/src/index.js @@ -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( @@ -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; }