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

Method bindForInOrForOfStatement

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

Source from the content-addressed store, hash-verified

1902}
1903
1904func (b *Binder) bindForInOrForOfStatement(node *ast.Node) {
1905 stmt := node.AsForInOrOfStatement()
1906 preLoopLabel := b.setContinueTarget(node, b.createLoopLabel())
1907 postLoopLabel := b.createBranchLabel()
1908 b.bind(stmt.Expression)
1909 b.addAntecedent(preLoopLabel, b.currentFlow)
1910 b.currentFlow = preLoopLabel
1911 if node.Kind == ast.KindForOfStatement {
1912 b.bind(stmt.AwaitModifier)
1913 }
1914 b.addAntecedent(postLoopLabel, b.currentFlow)
1915 b.bind(stmt.Initializer)
1916 if stmt.Initializer.Kind != ast.KindVariableDeclarationList {
1917 b.bindAssignmentTargetFlow(stmt.Initializer)
1918 }
1919 b.bindIterativeStatement(stmt.Statement, postLoopLabel, preLoopLabel)
1920 b.addAntecedent(preLoopLabel, b.currentFlow)
1921 b.currentFlow = b.finishFlowLabel(postLoopLabel)
1922}
1923
1924func (b *Binder) bindIfStatement(node *ast.Node) {
1925 stmt := node.AsIfStatement()

Callers 1

bindChildrenMethod · 0.95

Calls 9

setContinueTargetMethod · 0.95
createLoopLabelMethod · 0.95
createBranchLabelMethod · 0.95
bindMethod · 0.95
addAntecedentMethod · 0.95
finishFlowLabelMethod · 0.95
AsForInOrOfStatementMethod · 0.80

Tested by

no test coverage detected