Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow nodes that optionally provide a flow type will delegate to their antecedent to determine a flow type using a loop in `getFlowTypeOfReference`. If these nodes are marked as shared then their result should be cached for future lookups, but the registration inside `getFlowTypeOfReference` did only consider the most-recently processed flow node. Any flow nodes up to that point that did not provide a type but were marked as shared would therefore not be cached at all. This commit keeps track of the first seen shared flow node and ensures that the result type is cached for that node.
- Loading branch information
Showing
5 changed files
with
962 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
tests/baselines/reference/controlFlowManyCallExpressionStatementsPerf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
//// [controlFlowManyCallExpressionStatementsPerf.ts] | ||
function test(x: boolean): boolean { return x; } | ||
|
||
let state = true; | ||
|
||
if (state) { | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
test(state as any && state); | ||
} | ||
|
||
//// [controlFlowManyCallExpressionStatementsPerf.js] | ||
function test(x) { return x; } | ||
var state = true; | ||
if (state) { | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
test(state && state); | ||
} |
Oops, something went wrong.