mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
do not reset current flow after processing finally block if it was unreachable (#11310)
* do not reset current flow after processing finally block if it was unreachable * fix tests
This commit is contained in:
@@ -964,7 +964,11 @@ namespace ts {
|
||||
currentFlow = preTryFlow;
|
||||
bind(node.finallyBlock);
|
||||
}
|
||||
currentFlow = finishFlowLabel(postFinallyLabel);
|
||||
// if try statement has finally block and flow after finally block is unreachable - keep it
|
||||
// otherwise use whatever flow was accumulated at postFinallyLabel
|
||||
if (!node.finallyBlock || !(currentFlow.flags & FlowFlags.Unreachable)) {
|
||||
currentFlow = finishFlowLabel(postFinallyLabel);
|
||||
}
|
||||
}
|
||||
|
||||
function bindSwitchStatement(node: SwitchStatement): void {
|
||||
|
||||
Reference in New Issue
Block a user