From fc07ee2ad7b41b1afd3a14eeee56cd371198a76d Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sat, 15 May 2021 07:15:42 -0400 Subject: [PATCH] `skipParenthesesUp()` is exactly the same as `walkUpParenthesizedExpressions()` Remove the former since the latter is based on the generel `walkUp()`. --- src/compiler/utilities.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 6dfdc7b3138..0b2d044aa21 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2853,13 +2853,6 @@ namespace ts { return skipOuterExpressions(node, OuterExpressionKinds.Parentheses); } - function skipParenthesesUp(node: Node): Node { - while (node.kind === SyntaxKind.ParenthesizedExpression) { - node = node.parent; - } - return node; - } - // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped export function isDeleteTarget(node: Node): boolean { if (node.kind !== SyntaxKind.PropertyAccessExpression && node.kind !== SyntaxKind.ElementAccessExpression) { @@ -5397,7 +5390,7 @@ namespace ts { function writeOrReadWrite(): AccessKind { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === SyntaxKind.ExpressionStatement ? AccessKind.Write : AccessKind.ReadWrite; + return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === SyntaxKind.ExpressionStatement ? AccessKind.Write : AccessKind.ReadWrite; } } function reverseAccessKind(a: AccessKind): AccessKind {