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

Method bindCallExpressionFlow

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

Source from the content-addressed store, hash-verified

2412}
2413
2414func (b *Binder) bindCallExpressionFlow(node *ast.Node) {
2415 call := node.AsCallExpression()
2416 if ast.IsOptionalChain(node) {
2417 b.bindOptionalChainFlow(node)
2418 } else {
2419 // If the target of the call expression is a function expression or arrow function we have
2420 // an immediately invoked function expression (IIFE). Initialize the flowNode property to
2421 // the current control flow (which includes evaluation of the IIFE arguments).
2422 expr := ast.SkipParentheses(call.Expression)
2423 if expr.Kind == ast.KindFunctionExpression || expr.Kind == ast.KindArrowFunction {
2424 b.bindNodeList(call.TypeArguments)
2425 b.bindEach(call.Arguments.Nodes)
2426 b.bind(call.Expression)
2427 } else {
2428 b.bindEachChild(node)
2429 if call.Expression.Kind == ast.KindSuperKeyword {
2430 b.currentFlow = b.createFlowCall(b.currentFlow, node)
2431 }
2432 }
2433 }
2434 if ast.IsPropertyAccessExpression(call.Expression) {
2435 access := call.Expression.AsPropertyAccessExpression()
2436 if ast.IsIdentifier(access.Name()) && isNarrowableOperand(access.Expression) && ast.IsPushOrUnshiftIdentifier(access.Name()) {
2437 b.currentFlow = b.createFlowMutation(ast.FlowFlagsArrayMutation, b.currentFlow, node)
2438 }
2439 }
2440}
2441
2442func (b *Binder) bindNonNullExpressionFlow(node *ast.Node) {
2443 if ast.IsOptionalChain(node) {

Callers 1

bindChildrenMethod · 0.95

Calls 15

bindOptionalChainFlowMethod · 0.95
bindNodeListMethod · 0.95
bindEachMethod · 0.95
bindMethod · 0.95
bindEachChildMethod · 0.95
createFlowCallMethod · 0.95
createFlowMutationMethod · 0.95
IsOptionalChainFunction · 0.92
SkipParenthesesFunction · 0.92
IsIdentifierFunction · 0.92

Tested by

no test coverage detected