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

Method bindIfStatement

internal/binder/binder.go:1924–1937  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

1922}
1923
1924func (b *Binder) bindIfStatement(node *ast.Node) {
1925 stmt := node.AsIfStatement()
1926 thenLabel := b.createBranchLabel()
1927 elseLabel := b.createBranchLabel()
1928 postIfLabel := b.createBranchLabel()
1929 b.bindCondition(stmt.Expression, thenLabel, elseLabel)
1930 b.currentFlow = b.finishFlowLabel(thenLabel)
1931 b.bind(stmt.ThenStatement)
1932 b.addAntecedent(postIfLabel, b.currentFlow)
1933 b.currentFlow = b.finishFlowLabel(elseLabel)
1934 b.bind(stmt.ElseStatement)
1935 b.addAntecedent(postIfLabel, b.currentFlow)
1936 b.currentFlow = b.finishFlowLabel(postIfLabel)
1937}
1938
1939func (b *Binder) bindReturnStatement(node *ast.Node) {
1940 b.bind(node.Expression())

Callers 1

bindChildrenMethod · 0.95

Calls 6

createBranchLabelMethod · 0.95
bindConditionMethod · 0.95
finishFlowLabelMethod · 0.95
bindMethod · 0.95
addAntecedentMethod · 0.95
AsIfStatementMethod · 0.80

Tested by

no test coverage detected