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

Function IsAssignmentExpression

internal/ast/utilities.go:116–123  ·  view source on GitHub ↗
(node *Node, excludeCompoundAssignment bool)

Source from the content-addressed store, hash-verified

114}
115
116func IsAssignmentExpression(node *Node, excludeCompoundAssignment bool) bool {
117 if node.Kind == KindBinaryExpression {
118 expr := node.AsBinaryExpression()
119 return (expr.OperatorToken.Kind == KindEqualsToken || !excludeCompoundAssignment && IsAssignmentOperator(expr.OperatorToken.Kind)) &&
120 IsLeftHandSideExpression(expr.Left)
121 }
122 return false
123}
124
125func GetRightMostAssignedExpression(node *Node) *Node {
126 for IsAssignmentExpression(node, false /*excludeCompoundAssignment*/) {

Calls 3

IsAssignmentOperatorFunction · 0.85
IsLeftHandSideExpressionFunction · 0.85
AsBinaryExpressionMethod · 0.80

Tested by

no test coverage detected