Emit parens when an argument is a comma operator
Example: foo`A${ 1 }B${ 2, 3 }C`;
This commit is contained in:
parent
69d724f554
commit
8f28c95b04
1 changed files with 3 additions and 1 deletions
|
@ -2079,7 +2079,9 @@ module ts {
|
|||
// Now we emit the expressions
|
||||
forEach(node.templateSpans, templateSpan => {
|
||||
write(", ");
|
||||
emit(templateSpan.expression);
|
||||
var needsParens = templateSpan.expression.kind === SyntaxKind.BinaryExpression
|
||||
&& (<BinaryExpression> templateSpan.expression).operator === SyntaxKind.CommaToken;
|
||||
emitParenthesized(templateSpan.expression, needsParens);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue