@@ -333,7 +333,7 @@ namespace ts {
333
333
334
334
let flowLoopStart = 0;
335
335
let flowLoopCount = 0;
336
- let visitedFlowCount = 0;
336
+ let sharedFlowCount = 0;
337
337
let flowAnalysisDisabled = false;
338
338
339
339
const emptyStringType = getLiteralType("");
@@ -352,8 +352,8 @@ namespace ts {
352
352
const flowLoopNodes: FlowNode[] = [];
353
353
const flowLoopKeys: string[] = [];
354
354
const flowLoopTypes: Type[][] = [];
355
- const visitedFlowNodes : FlowNode[] = [];
356
- const visitedFlowTypes : FlowType[] = [];
355
+ const sharedFlowNodes : FlowNode[] = [];
356
+ const sharedFlowTypes : FlowType[] = [];
357
357
const potentialThisCollisions: Node[] = [];
358
358
const potentialNewTargetCollisions: Node[] = [];
359
359
const awaitedTypeStack: number[] = [];
@@ -11502,9 +11502,9 @@ namespace ts {
11502
11502
if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & TypeFlags.Narrowable)) {
11503
11503
return declaredType;
11504
11504
}
11505
- const visitedFlowStart = visitedFlowCount ;
11505
+ const sharedFlowStart = sharedFlowCount ;
11506
11506
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
11507
- visitedFlowCount = visitedFlowStart ;
11507
+ sharedFlowCount = sharedFlowStart ;
11508
11508
// When the reference is 'x' in an 'x.length', 'x.push(value)', 'x.unshift(value)' or x[n] = value' operation,
11509
11509
// we give type 'any[]' to 'x' instead of using the type determined by control flow analysis such that operations
11510
11510
// on empty arrays are possible without implicit any errors and new element types can be inferred without
@@ -11532,9 +11532,9 @@ namespace ts {
11532
11532
// We cache results of flow type resolution for shared nodes that were previously visited in
11533
11533
// the same getFlowTypeOfReference invocation. A node is considered shared when it is the
11534
11534
// antecedent of more than one node.
11535
- for (let i = visitedFlowStart ; i < visitedFlowCount ; i++) {
11536
- if (visitedFlowNodes [i] === flow) {
11537
- return visitedFlowTypes [i];
11535
+ for (let i = sharedFlowStart ; i < sharedFlowCount ; i++) {
11536
+ if (sharedFlowNodes [i] === flow) {
11537
+ return sharedFlowTypes [i];
11538
11538
}
11539
11539
}
11540
11540
}
@@ -11597,9 +11597,9 @@ namespace ts {
11597
11597
}
11598
11598
if (flags & FlowFlags.Shared) {
11599
11599
// Record visited node and the associated type in the cache.
11600
- visitedFlowNodes[visitedFlowCount ] = flow;
11601
- visitedFlowTypes[visitedFlowCount ] = type;
11602
- visitedFlowCount ++;
11600
+ sharedFlowNodes[sharedFlowCount ] = flow;
11601
+ sharedFlowTypes[sharedFlowCount ] = type;
11602
+ sharedFlowCount ++;
11603
11603
}
11604
11604
return type;
11605
11605
}
0 commit comments