Skip to content

Comments

feat(ast): add AstKind::ident_reference_is_assigned_to_in_parent method#12597

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-29-feat_ast_add_astkind_ident_reference_is_assigned_to_in_parent_method
Jul 30, 2025
Merged

feat(ast): add AstKind::ident_reference_is_assigned_to_in_parent method#12597
graphite-app[bot] merged 1 commit intomainfrom
07-29-feat_ast_add_astkind_ident_reference_is_assigned_to_in_parent_method

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 29, 2025

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.

Copy link
Member Author

overlookmotel commented Jul 29, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 29, 2025

CodSpeed Instrumentation Performance Report

Merging #12597 will not alter performance

Comparing 07-29-feat_ast_add_astkind_ident_reference_is_assigned_to_in_parent_method (26249cf) with 07-29-feat_ast_add_memberexpressionkind_is_assigned_to_in_parent_method (106f56f)

Summary

✅ 34 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review July 29, 2025 22:21
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 30, 2025
Copy link
Member

Boshen commented Jul 30, 2025

Merge activity

…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`.
@graphite-app graphite-app bot force-pushed the 07-29-feat_ast_add_memberexpressionkind_is_assigned_to_in_parent_method branch from 3279c53 to 106f56f Compare July 30, 2025 01:25
@graphite-app graphite-app bot force-pushed the 07-29-feat_ast_add_astkind_ident_reference_is_assigned_to_in_parent_method branch from 2460433 to 26249cf Compare July 30, 2025 01:26
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 30, 2025
Base automatically changed from 07-29-feat_ast_add_memberexpressionkind_is_assigned_to_in_parent_method to main July 30, 2025 01:33
@graphite-app graphite-app bot merged commit 26249cf into main Jul 30, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 07-29-feat_ast_add_astkind_ident_reference_is_assigned_to_in_parent_method branch July 30, 2025 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants