From 39027d901a8adcc69c7b0d4ce669269406bf40a4 Mon Sep 17 00:00:00 2001 From: Ivo Gabe de Wolff Date: Fri, 23 Jan 2015 15:46:32 +0100 Subject: [PATCH] Rename emitParenthesized to emitParenthesizedIf --- src/compiler/emitter.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index a4374690fb0..5e7d2d25027 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1953,7 +1953,7 @@ module ts { } } - function emitParenthesized(node: Node, parenthesized: boolean) { + function emitParenthesizedIf(node: Node, parenthesized: boolean) { if (parenthesized) { write("("); } @@ -2111,7 +2111,7 @@ module ts { write(", "); var needsParens = templateSpan.expression.kind === SyntaxKind.BinaryExpression && (templateSpan.expression).operator === SyntaxKind.CommaToken; - emitParenthesized(templateSpan.expression, needsParens); + emitParenthesizedIf(templateSpan.expression, needsParens); }); } write("))"); @@ -2149,7 +2149,7 @@ module ts { var needsParens = templateSpan.expression.kind !== SyntaxKind.ParenthesizedExpression && comparePrecedenceToBinaryPlus(templateSpan.expression) !== Comparison.GreaterThan; write(" + "); - emitParenthesized(templateSpan.expression, needsParens); + emitParenthesizedIf(templateSpan.expression, needsParens); // Only emit if the literal is non-empty. // The binary '+' operator is left-associative, so the first string concatenation // with the head will force the result up to this point to be a string. @@ -2395,7 +2395,7 @@ module ts { var e = elements[pos]; if (e.kind === SyntaxKind.SpreadElementExpression) { e = (e).expression; - emitParenthesized(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccess(e)); + emitParenthesizedIf(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccess(e)); pos++; } else { @@ -2703,7 +2703,7 @@ module ts { function emitExpressionStatement(node: ExpressionStatement) { emitLeadingComments(node); - emitParenthesized(node.expression, /*parenthesized*/ node.expression.kind === SyntaxKind.ArrowFunction); + emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === SyntaxKind.ArrowFunction); write(";"); emitTrailingComments(node); }