Skip to content

Commit 32513a7

Browse files
authored
Fixed an accidental undefined leak into getAccessibleSymbolChain's cache key (#58669)
1 parent e4dc78a commit 32513a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5566,7 +5566,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
55665566
const cache = (links.accessibleChainCache ||= new Map());
55675567
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
55685568
const firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, (_, __, ___, node) => node);
5569-
const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation && getNodeId(firstRelevantLocation)}|${meaning}`;
5569+
const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation ? getNodeId(firstRelevantLocation) : 0}|${meaning}`;
55705570
if (cache.has(key)) {
55715571
return cache.get(key);
55725572
}

0 commit comments

Comments
 (0)