Merge pull request #1094 from Microsoft/findAllRefsInTemplates

Corrected isExpression for templates.
This commit is contained in:
Daniel Rosenwasser
2014-11-07 16:24:22 -08:00
5 changed files with 29 additions and 3 deletions

View File

@@ -491,6 +491,7 @@ module ts {
case SyntaxKind.BinaryExpression:
case SyntaxKind.ConditionalExpression:
case SyntaxKind.TemplateExpression:
case SyntaxKind.NoSubstitutionTemplateLiteral:
case SyntaxKind.OmittedExpression:
return true;
case SyntaxKind.QualifiedName:
@@ -503,7 +504,6 @@ module ts {
// fall through
case SyntaxKind.NumericLiteral:
case SyntaxKind.StringLiteral:
case SyntaxKind.NoSubstitutionTemplateLiteral:
var parent = node.parent;
switch (parent.kind) {
case SyntaxKind.VariableDeclaration:
@@ -532,6 +532,8 @@ module ts {
(<ForInStatement>parent).expression === node;
case SyntaxKind.TypeAssertion:
return node === (<TypeAssertion>parent).operand;
case SyntaxKind.TemplateSpan:
return node === (<TemplateSpan>parent).expression;
default:
if (isExpression(parent)) {
return true;