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

Function isTopLevelLogicalExpression

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

Source from the content-addressed store, hash-verified

2780}
2781
2782func isTopLevelLogicalExpression(node *ast.Node) bool {
2783 for ast.IsParenthesizedExpression(node.Parent) || ast.IsPrefixUnaryExpression(node.Parent) && node.Parent.AsPrefixUnaryExpression().Operator == ast.KindExclamationToken {
2784 node = node.Parent
2785 }
2786 return !isStatementCondition(node) && !ast.IsLogicalExpression(node.Parent) && !(ast.IsOptionalChain(node.Parent) && node.Parent.Expression() == node)
2787}
2788
2789func isAssignmentDeclaration(decl *ast.Node) bool {
2790 return ast.IsBinaryExpression(decl) || ast.IsAccessExpression(decl) || ast.IsIdentifier(decl) || ast.IsCallExpression(decl)

Callers 2

bindOptionalChainFlowMethod · 0.85

Calls 7

IsPrefixUnaryExpressionFunction · 0.92
IsLogicalExpressionFunction · 0.92
IsOptionalChainFunction · 0.92
isStatementConditionFunction · 0.85
ExpressionMethod · 0.80

Tested by

no test coverage detected