MCPcopy Create free account
hub / github.com/microsoft/typescript-go / bindCondition

Method bindCondition

internal/binder/binder.go:1799–1805  ·  view source on GitHub ↗
(node *ast.Node, trueTarget *ast.FlowLabel, falseTarget *ast.FlowLabel)

Source from the content-addressed store, hash-verified

1797}
1798
1799func (b *Binder) bindCondition(node *ast.Node, trueTarget *ast.FlowLabel, falseTarget *ast.FlowLabel) {
1800 b.doWithConditionalBranches((*Binder).bind, node, trueTarget, falseTarget)
1801 if node == nil || !isLogicalAssignmentExpression(node) && !ast.IsLogicalExpression(node) && !(ast.IsOptionalChain(node) && ast.IsOutermostOptionalChain(node)) {
1802 b.addAntecedent(trueTarget, b.createFlowCondition(ast.FlowFlagsTrueCondition, b.currentFlow, node))
1803 b.addAntecedent(falseTarget, b.createFlowCondition(ast.FlowFlagsFalseCondition, b.currentFlow, node))
1804 }
1805}
1806
1807func (b *Binder) bindIterativeStatement(node *ast.Node, breakTarget *ast.FlowLabel, continueTarget *ast.FlowLabel) {
1808 saveBreakTarget := b.currentBreakTarget

Callers 6

bindWhileStatementMethod · 0.95
bindDoStatementMethod · 0.95
bindForStatementMethod · 0.95
bindIfStatementMethod · 0.95

Calls 7

addAntecedentMethod · 0.95
createFlowConditionMethod · 0.95
IsLogicalExpressionFunction · 0.92
IsOptionalChainFunction · 0.92
IsOutermostOptionalChainFunction · 0.92

Tested by

no test coverage detected