Proper handling of "this" in getSymbolAtLocation

This commit is contained in:
Anders Hejlsberg
2015-09-26 07:57:39 -07:00
parent 9594835046
commit 47c9190408
2 changed files with 3 additions and 2 deletions

View File

@@ -14283,7 +14283,7 @@ namespace ts {
case SyntaxKind.ThisKeyword:
case SyntaxKind.SuperKeyword:
let type = checkExpression(<Expression>node);
let type = isExpression(node) ? checkExpression(<Expression>node) : getTypeFromTypeNode(<TypeNode>node);
return type.symbol;
case SyntaxKind.ConstructorKeyword:

View File

@@ -6249,7 +6249,8 @@ namespace ts {
}
return node.parent.kind === SyntaxKind.TypeReference ||
(node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(<ExpressionWithTypeArguments>node.parent));
(node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(<ExpressionWithTypeArguments>node.parent)) ||
node.kind === SyntaxKind.ThisKeyword && !isExpression(node);
}
function isNamespaceReference(node: Node): boolean {