Attach flow nodes only when allowUnreachableCode !== true
This commit is contained in:
parent
9466025996
commit
ba30fdc4ae
|
@ -672,7 +672,7 @@ namespace ts {
|
|||
bindJSDoc(node);
|
||||
return;
|
||||
}
|
||||
if (node.kind >= SyntaxKind.FirstStatement && node.kind <= SyntaxKind.LastStatement) {
|
||||
if (node.kind >= SyntaxKind.FirstStatement && node.kind <= SyntaxKind.LastStatement && !options.allowUnreachableCode) {
|
||||
node.flowNode = currentFlow;
|
||||
}
|
||||
switch (node.kind) {
|
||||
|
|
|
@ -30539,8 +30539,7 @@ namespace ts {
|
|||
cancellationToken.throwIfCancellationRequested();
|
||||
}
|
||||
}
|
||||
if (kind >= SyntaxKind.FirstStatement && kind <= SyntaxKind.LastStatement &&
|
||||
!compilerOptions.allowUnreachableCode && node.flowNode && !isReachableFlowNode(node.flowNode)) {
|
||||
if (kind >= SyntaxKind.FirstStatement && kind <= SyntaxKind.LastStatement && node.flowNode && !isReachableFlowNode(node.flowNode)) {
|
||||
errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue