Skip to content

Commit 977525b

Browse files
author
Andy
authored
getSymbolOfEntityNameOrPropertyAccessExpression: combine common code from PropertyAccessExpression and QualifiedName cases (#16827)
1 parent d73b05c commit 977525b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/compiler/checker.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22500,25 +22500,25 @@ namespace ts {
2250022500
}
2250122501

2250222502
if (entityName.kind === SyntaxKind.Identifier) {
22503-
if (isJSXTagName(entityName) && isJsxIntrinsicIdentifier(<Identifier>entityName)) {
22503+
if (isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) {
2250422504
return getIntrinsicTagSymbol(<JsxOpeningLikeElement>entityName.parent);
2250522505
}
2250622506

22507-
return resolveEntityName(<Identifier>entityName, SymbolFlags.Value, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
22507+
return resolveEntityName(entityName, SymbolFlags.Value, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
2250822508
}
22509-
else if (entityName.kind === SyntaxKind.PropertyAccessExpression) {
22510-
const symbol = getNodeLinks(entityName).resolvedSymbol;
22511-
if (!symbol) {
22512-
checkPropertyAccessExpression(<PropertyAccessExpression>entityName);
22509+
else if (entityName.kind === SyntaxKind.PropertyAccessExpression || entityName.kind === SyntaxKind.QualifiedName) {
22510+
const links = getNodeLinks(entityName);
22511+
if (links.resolvedSymbol) {
22512+
return links.resolvedSymbol;
2251322513
}
22514-
return getNodeLinks(entityName).resolvedSymbol;
22515-
}
22516-
else if (entityName.kind === SyntaxKind.QualifiedName) {
22517-
const symbol = getNodeLinks(entityName).resolvedSymbol;
22518-
if (!symbol) {
22519-
checkQualifiedName(<QualifiedName>entityName);
22514+
22515+
if (entityName.kind === SyntaxKind.PropertyAccessExpression) {
22516+
checkPropertyAccessExpression(entityName);
22517+
}
22518+
else {
22519+
checkQualifiedName(entityName);
2252022520
}
22521-
return getNodeLinks(entityName).resolvedSymbol;
22521+
return links.resolvedSymbol;
2252222522
}
2252322523
}
2252422524
else if (isTypeReferenceIdentifier(<EntityName>entityName)) {

0 commit comments

Comments
 (0)