Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
gabritto committed Sep 6, 2022
1 parent feb0ab7 commit 3b2c300
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 120 deletions.
16 changes: 3 additions & 13 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43076,7 +43076,7 @@ namespace ts {
}
const node = getParseTreeNode(nodeIn, isIdentifier);
if (node) {
const symbol = getReferencedSymbol(node, /*startInDeclarationContainer*/ undefined);
const symbol = getReferencedValueOrAliasSymbol(node);

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

let location: Node = reference;
if (startInDeclarationContainer) {
// When resolving the name of a declaration as a value, we need to start resolution
// at a point outside of the declaration.
const parent = reference.parent;
if (isDeclaration(parent) && reference === parent.name) {
location = getDeclarationContainer(parent);
}
}

return resolveName(
location,
reference,
reference.escapedText,
SymbolFlags.Value | SymbolFlags.ExportValue | SymbolFlags.Alias,
/*nodeNotFoundMessage*/ undefined,
Expand Down
26 changes: 0 additions & 26 deletions tests/baselines/reference/elidedJSImport.js

This file was deleted.

40 changes: 0 additions & 40 deletions tests/baselines/reference/elidedJSImport.symbols

This file was deleted.

41 changes: 0 additions & 41 deletions tests/baselines/reference/elidedJSImport.types

This file was deleted.

0 comments on commit 3b2c300

Please sign in to comment.