Skip to content

Commit

Permalink
[squash] remove change to parenthesizerRules
Browse files Browse the repository at this point in the history
Signed-off-by: Ashley Claymore <acutmore@users.noreply.github.com>
  • Loading branch information
acutmore committed Sep 21, 2021
1 parent c007a12 commit 40bd336
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions src/compiler/factory/parenthesizerRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ namespace ts {
const binaryOperatorPrecedence = getOperatorPrecedence(SyntaxKind.BinaryExpression, binaryOperator);
const binaryOperatorAssociativity = getOperatorAssociativity(SyntaxKind.BinaryExpression, binaryOperator);
const emittedOperand = skipPartiallyEmittedExpressions(operand);
// If a privateIdentifier is on the left side, this is not a real expression and
// should not become parenthesized
if (isLeftSideOfBinary && isPrivateIdentifier(operand)) {
return false;
}
if (!isLeftSideOfBinary && operand.kind === SyntaxKind.ArrowFunction && binaryOperatorPrecedence > OperatorPrecedence.Assignment) {
// We need to parenthesize arrow functions on the right side to avoid it being
// parsed as parenthesized expression: `a && (() => {})`
Expand Down
1 change: 1 addition & 0 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3706,6 +3706,7 @@ namespace ts {
case SyntaxKind.ThisKeyword:
case SyntaxKind.SuperKeyword:
case SyntaxKind.Identifier:
case SyntaxKind.PrivateIdentifier:
case SyntaxKind.NullKeyword:
case SyntaxKind.TrueKeyword:
case SyntaxKind.FalseKeyword:
Expand Down

0 comments on commit 40bd336

Please sign in to comment.