Skip to content

Commit b7d31bc

Browse files
Switch to sparse array for deferred nodes.
1 parent e23710a commit b7d31bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/checker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -40317,8 +40317,8 @@ namespace ts {
4031740317
const enclosingFile = getSourceFileOfNode(node);
4031840318
const links = getNodeLinks(enclosingFile);
4031940319
if (!(links.flags & NodeCheckFlags.TypeChecked)) {
40320-
links.deferredNodes ||= new Set();
40321-
links.deferredNodes.add(node);
40320+
links.deferredNodes ||= [];
40321+
links.deferredNodes[getNodeId(node)] = node;
4032240322
}
4032340323
}
4032440324

src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5106,7 +5106,7 @@ namespace ts {
51065106
jsxNamespace?: Symbol | false; // Resolved jsx namespace symbol for this node
51075107
jsxImplicitImportContainer?: Symbol | false; // Resolved module symbol the implicit jsx import of this file should refer to
51085108
contextFreeType?: Type; // Cached context-free type used by the first pass of inference; used when a function's return is partially contextually sensitive
5109-
deferredNodes?: Set<Node>; // Set of nodes whose checking has been deferred
5109+
deferredNodes?: Node[]; // Sparse array of nodes whose checking has been deferred
51105110
capturedBlockScopeBindings?: Symbol[]; // Block-scoped bindings captured beneath this part of an IterationStatement
51115111
outerTypeParameters?: TypeParameter[]; // Outer type parameters of anonymous object type
51125112
isExhaustive?: boolean; // Is node an exhaustive switch statement

0 commit comments

Comments
 (0)