mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix bug
This commit is contained in:
1 parent
91c9d76f09
commit
db44a71005
1 file changed
+16
-14
+16
-14
@@ -980,21 +980,23 @@ namespace ts {
|
||||
* but returns undefined if that expression is not an EntityNameExpression.
|
||||
*/
|
||||
function climbToEntityNameOfExpressionWithTypeArguments(node: Node): EntityNameExpression | undefined {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
if (node.parent) {
|
||||
node = node.parent;
|
||||
}
|
||||
else {
|
||||
for (; ; ) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
if (node.parent) {
|
||||
node = node.parent;
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
Debug.assert(isEntityNameExpression((<ExpressionWithTypeArguments>node).expression));
|
||||
return <EntityNameExpression>(<ExpressionWithTypeArguments>node).expression;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
Debug.assert(isEntityNameExpression((<ExpressionWithTypeArguments>node).expression));
|
||||
return <EntityNameExpression>(<ExpressionWithTypeArguments>node).expression;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user