Skip to content

Commit fc07ee2

Browse files
committed
skipParenthesesUp() is exactly the same as walkUpParenthesizedExpressions()
Remove the former since the latter is based on the generel `walkUp()`.
1 parent 1c12eee commit fc07ee2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/compiler/utilities.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -2853,13 +2853,6 @@ namespace ts {
28532853
return skipOuterExpressions(node, OuterExpressionKinds.Parentheses);
28542854
}
28552855

2856-
function skipParenthesesUp(node: Node): Node {
2857-
while (node.kind === SyntaxKind.ParenthesizedExpression) {
2858-
node = node.parent;
2859-
}
2860-
return node;
2861-
}
2862-
28632856
// a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped
28642857
export function isDeleteTarget(node: Node): boolean {
28652858
if (node.kind !== SyntaxKind.PropertyAccessExpression && node.kind !== SyntaxKind.ElementAccessExpression) {
@@ -5397,7 +5390,7 @@ namespace ts {
53975390

53985391
function writeOrReadWrite(): AccessKind {
53995392
// If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect.
5400-
return parent.parent && skipParenthesesUp(parent.parent).kind === SyntaxKind.ExpressionStatement ? AccessKind.Write : AccessKind.ReadWrite;
5393+
return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === SyntaxKind.ExpressionStatement ? AccessKind.Write : AccessKind.ReadWrite;
54015394
}
54025395
}
54035396
function reverseAccessKind(a: AccessKind): AccessKind {

0 commit comments

Comments
 (0)