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

Function IsAssignmentTarget

internal/ast/utilities.go:178–180  ·  view source on GitHub ↗

A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property assignment in an object literal that is an assignment target, or if it is parented by an array literal that is an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ a }] =

(node *Node)

Source from the content-addressed store, hash-verified

176// an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ a }] = xxx'.
177// (Note that `p` is not a target in the above examples, only `a`.)
178func IsAssignmentTarget(node *Node) bool {
179 return GetAssignmentTarget(node) != nil
180}
181
182// Returns the BinaryExpression, PrefixUnaryExpression, PostfixUnaryExpression, or ForInOrOfStatement that references
183// the given node as an assignment target

Calls 1

GetAssignmentTargetFunction · 0.85

Tested by

no test coverage detected