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

Method bindOptionalExpression

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

Source from the content-addressed store, hash-verified

2388}
2389
2390func (b *Binder) bindOptionalExpression(node *ast.Node, trueTarget *ast.FlowLabel, falseTarget *ast.FlowLabel) {
2391 b.doWithConditionalBranches((*Binder).bind, node, trueTarget, falseTarget)
2392 if !ast.IsOptionalChain(node) || ast.IsOutermostOptionalChain(node) {
2393 b.addAntecedent(trueTarget, b.createFlowCondition(ast.FlowFlagsTrueCondition, b.currentFlow, node))
2394 b.addAntecedent(falseTarget, b.createFlowCondition(ast.FlowFlagsFalseCondition, b.currentFlow, node))
2395 }
2396}
2397
2398func (b *Binder) bindOptionalChainRest(node *ast.Node) bool {
2399 switch node.Kind {

Callers 1

bindOptionalChainMethod · 0.95

Calls 5

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

Tested by

no test coverage detected