mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 13:45:34 -05:00
Addressed CR feedback.
This commit is contained in:
@@ -869,14 +869,13 @@ module ts {
|
||||
|
||||
function templateNeedsParens(template: TemplateExpression, parent: Expression) {
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6!");
|
||||
//return (<TaggedTemplateExpression>parent).tag === template;
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.NewExpression:
|
||||
return (<CallExpression>parent).func === template;
|
||||
case SyntaxKind.ParenExpression:
|
||||
return false;
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6.");
|
||||
default:
|
||||
return comparePrecedenceToBinaryPlus(parent) !== Comparison.LessThan;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user