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

Method bindInitializedVariableFlow

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

Source from the content-addressed store, hash-verified

2319}
2320
2321func (b *Binder) bindInitializedVariableFlow(node *ast.Node) {
2322 var name *ast.Node
2323 switch node.Kind {
2324 case ast.KindVariableDeclaration:
2325 name = node.AsVariableDeclaration().Name()
2326 case ast.KindBindingElement:
2327 name = node.AsBindingElement().Name()
2328 }
2329 if name != nil && ast.IsBindingPattern(name) {
2330 for _, child := range name.Elements() {
2331 b.bindInitializedVariableFlow(child)
2332 }
2333 } else {
2334 b.currentFlow = b.createFlowMutation(ast.FlowFlagsAssignment, b.currentFlow, node)
2335 }
2336}
2337
2338func (b *Binder) bindAccessExpressionFlow(node *ast.Node) {
2339 if ast.IsOptionalChain(node) {

Callers 1

Calls 6

ElementsMethod · 0.95
createFlowMutationMethod · 0.95
IsBindingPatternFunction · 0.92
AsVariableDeclarationMethod · 0.80
AsBindingElementMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected