Skip to content

Commit

Permalink
Fixed an accidental undefined leak into getAccessibleSymbolChain'…
Browse files Browse the repository at this point in the history
…s cache key (#58669)
  • Loading branch information
Andarist authored Oct 31, 2024
1 parent e4dc78a commit 32513a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5566,7 +5566,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const cache = (links.accessibleChainCache ||= new Map());
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
const firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, (_, __, ___, node) => node);
const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation && getNodeId(firstRelevantLocation)}|${meaning}`;
const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation ? getNodeId(firstRelevantLocation) : 0}|${meaning}`;
if (cache.has(key)) {
return cache.get(key);
}
Expand Down

0 comments on commit 32513a7

Please sign in to comment.