(flags ast.FlowFlags, antecedent *ast.FlowNode, expression *ast.Node)
| 477 | } |
| 478 | |
| 479 | func (b *Binder) createFlowCondition(flags ast.FlowFlags, antecedent *ast.FlowNode, expression *ast.Node) *ast.FlowNode { |
| 480 | if antecedent.Flags&ast.FlowFlagsUnreachable != 0 { |
| 481 | return antecedent |
| 482 | } |
| 483 | if expression == nil { |
| 484 | if flags&ast.FlowFlagsTrueCondition != 0 { |
| 485 | return antecedent |
| 486 | } |
| 487 | return b.unreachableFlow |
| 488 | } |
| 489 | if (expression.Kind == ast.KindTrueKeyword && flags&ast.FlowFlagsFalseCondition != 0 || expression.Kind == ast.KindFalseKeyword && flags&ast.FlowFlagsTrueCondition != 0) && !ast.IsExpressionOfOptionalChainRoot(expression) && !ast.IsNullishCoalesce(expression.Parent) { |
| 490 | return b.unreachableFlow |
| 491 | } |
| 492 | if !isNarrowingExpression(expression) { |
| 493 | return antecedent |
| 494 | } |
| 495 | setFlowNodeReferenced(antecedent) |
| 496 | return b.newFlowNodeEx(flags, expression, antecedent) |
| 497 | } |
| 498 | |
| 499 | func (b *Binder) createFlowMutation(flags ast.FlowFlags, antecedent *ast.FlowNode, node *ast.Node) *ast.FlowNode { |
| 500 | setFlowNodeReferenced(antecedent) |
no test coverage detected