Skip to content

Commit 3b2c300

Browse files
committed
clean up
1 parent feb0ab7 commit 3b2c300

File tree

4 files changed

+3
-120
lines changed

4 files changed

+3
-120
lines changed

src/compiler/checker.ts

+3-13
Original file line numberDiff line numberDiff line change
@@ -43076,7 +43076,7 @@ namespace ts {
4307643076
}
4307743077
const node = getParseTreeNode(nodeIn, isIdentifier);
4307843078
if (node) {
43079-
const symbol = getReferencedSymbol(node, /*startInDeclarationContainer*/ undefined);
43079+
const symbol = getReferencedValueOrAliasSymbol(node);
4308043080

4308143081
// We should only get the declaration of an alias if there isn't a local value
4308243082
// declaration for the symbol
@@ -43488,24 +43488,14 @@ namespace ts {
4348843488
* This is because when caching the resolved symbol, we only consider value symbols, but here
4348943489
* we want to also get an alias symbol if one exists.
4349043490
*/
43491-
function getReferencedSymbol(reference: Identifier, startInDeclarationContainer?: boolean): Symbol | undefined {
43491+
function getReferencedValueOrAliasSymbol(reference: Identifier): Symbol | undefined {
4349243492
const resolvedSymbol = getNodeLinks(reference).resolvedSymbol;
4349343493
if (resolvedSymbol && resolvedSymbol !== unknownSymbol) {
4349443494
return resolvedSymbol;
4349543495
}
4349643496

43497-
let location: Node = reference;
43498-
if (startInDeclarationContainer) {
43499-
// When resolving the name of a declaration as a value, we need to start resolution
43500-
// at a point outside of the declaration.
43501-
const parent = reference.parent;
43502-
if (isDeclaration(parent) && reference === parent.name) {
43503-
location = getDeclarationContainer(parent);
43504-
}
43505-
}
43506-
4350743497
return resolveName(
43508-
location,
43498+
reference,
4350943499
reference.escapedText,
4351043500
SymbolFlags.Value | SymbolFlags.ExportValue | SymbolFlags.Alias,
4351143501
/*nodeNotFoundMessage*/ undefined,

tests/baselines/reference/elidedJSImport.js

-26
This file was deleted.

tests/baselines/reference/elidedJSImport.symbols

-40
This file was deleted.

tests/baselines/reference/elidedJSImport.types

-41
This file was deleted.

0 commit comments

Comments
 (0)