From a90389a22d992c3710918ce8fc5a2a37c21ad763 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 23 Nov 2021 18:46:33 -0700 Subject: [PATCH] Switch deferredNodes from a Map to a Set. (#46751) --- src/compiler/checker.ts | 5 ++--- src/compiler/types.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a90bbb2036..2e0f1ef628 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -40422,9 +40422,8 @@ namespace ts { const enclosingFile = getSourceFileOfNode(node); const links = getNodeLinks(enclosingFile); if (!(links.flags & NodeCheckFlags.TypeChecked)) { - links.deferredNodes = links.deferredNodes || new Map(); - const id = getNodeId(node); - links.deferredNodes.set(id, node); + links.deferredNodes ||= new Set(); + links.deferredNodes.add(node); } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5afcd961b7..b542487945 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5107,7 +5107,7 @@ namespace ts { jsxNamespace?: Symbol | false; // Resolved jsx namespace symbol for this node jsxImplicitImportContainer?: Symbol | false; // Resolved module symbol the implicit jsx import of this file should refer to contextFreeType?: Type; // Cached context-free type used by the first pass of inference; used when a function's return is partially contextually sensitive - deferredNodes?: ESMap; // Set of nodes whose checking has been deferred + deferredNodes?: Set; // Set of nodes whose checking has been deferred capturedBlockScopeBindings?: Symbol[]; // Block-scoped bindings captured beneath this part of an IterationStatement outerTypeParameters?: TypeParameter[]; // Outer type parameters of anonymous object type isExhaustive?: boolean; // Is node an exhaustive switch statement