Skip to content

Commit 589b3c1

Browse files
committed
Use a less memory intensive method to check if a node has already been bound
1 parent 1307496 commit 589b3c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/binder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ namespace ts {
227227
const reportedUnreachableFlow: FlowNode = { flags: FlowFlags.Unreachable };
228228
const bindBinaryExpressionFlow = createBindBinaryExpressionFlow();
229229

230-
const alreadyBound = new Set<Node>();
230+
let alreadyBound: WeakSet<Node>;
231231

232232
/**
233233
* Inside the binder, we may create a diagnostic for an as-yet unbound node (with potentially no parent pointers, implying no accessible source file)
@@ -245,6 +245,7 @@ namespace ts {
245245
inStrictMode = bindInStrictMode(file, opts);
246246
classifiableNames = new Set();
247247
symbolCount = 0;
248+
alreadyBound = new WeakSet();
248249

249250
Symbol = objectAllocator.getSymbolConstructor();
250251

@@ -282,7 +283,6 @@ namespace ts {
282283
hasExplicitReturn = false;
283284
inAssignmentPattern = false;
284285
emitFlags = NodeFlags.None;
285-
alreadyBound.clear();
286286
}
287287

288288
return bindSourceFile;

0 commit comments

Comments
 (0)