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