feat(ast): add MemberExpressionKind::is_assigned_to_in_parent method#12596
Merged
graphite-app[bot] merged 1 commit intomainfrom Jul 30, 2025
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 29, 2025
CodSpeed Instrumentation Performance ReportMerging #12596 will not alter performanceComparing Summary
Footnotes |
Contributor
Merge activity
|
#12596) The removal of `AstKind::SimpleAssignmentTarget` (#12401) has made it harder to determine if a node is being assigned to, because you can no longer check if the parent `AstNode` is `AstKind::SimpleAssignmentTarget`. Add a method to `MemberExpressionKind` which determines whether the parent assigns to it. Covers all possible positions where a `MemberExpression` gets assigned to - `x.y = value`, `x.y++`, `[x.y] = arr` etc. We can use this method to avoid repeating this complicated logic in many places.
c957caa to
c763e0e
Compare
3279c53 to
106f56f
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Jul 30, 2025
…thod (#12597) Similar to #12596. Add a method `AstKind::ident_reference_is_assigned_to_in_parent`. Given an `AstKind` representing an `IdentifierReference`, and an `AstKind` representing its parent, this method determines whether the identifier is being assigned to. Covers all possible positions where an `IdentifierReference` gets assigned to - `x = value`, `x++`, `[...x] = arr` etc. Note: This method is slightly different to `MemberExpressionKind::is_assigned_to_in_parent` - it includes additional match arm for `AssignmentTargetPropertyIdentifier` as parent. This can't be parent of a `MemberExpression`, but *can* be the parent of an `IdentifierReference`.
Base automatically changed from
07-29-feat_ast_implement_getaddress_for_memberexpressionkind_
to
main
July 30, 2025 01:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The removal of
AstKind::SimpleAssignmentTarget(#12401) has made it harder to determine if a node is being assigned to, because you can no longer check if the parentAstNodeisAstKind::SimpleAssignmentTarget.Add a method to
MemberExpressionKindwhich determines whether the parent assigns to it. Covers all possible positions where aMemberExpressiongets assigned to -x.y = value,x.y++,[x.y] = arretc.We can use this method to avoid repeating this complicated logic in many places.