Skip to content

fix(ast_tools): visit nested objects to add __proto__: NodeProto in raw transfer codegen#17230

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/12-21-fix_ast_tools_visit_nested_objects_to_add___proto___nodeproto_in_raw_transfer_codegen
Dec 21, 2025
Merged

fix(ast_tools): visit nested objects to add __proto__: NodeProto in raw transfer codegen#17230
graphite-app[bot] merged 1 commit intomainfrom
om/12-21-fix_ast_tools_visit_nested_objects_to_add___proto___nodeproto_in_raw_transfer_codegen

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 21, 2025

Fix a bug in codegen for ESTree walker, where it didn't visit nested objects when it adds __proto__: NodeProto to node objects. This doesn't make any difference now, but fixing it is required for next PR (#17231).

@github-actions github-actions bot added A-ast-tools Area - AST tools C-bug Category - Bug labels Dec 21, 2025
Copy link
Member Author

overlookmotel commented Dec 21, 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the ESTree walker codegen where nested objects were not being visited when adding __proto__: NodeProto to node objects. The fix ensures that all object expressions (including nested ones) with a range field will receive the __proto__ property.

  • Refactored the conditional logic to use a positive condition instead of early return
  • Added walk_mut::walk_object_expression call to recursively visit nested object expressions
  • Imported walk_mut from oxc_ast_visit to enable the recursive walking functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel force-pushed the om/12-21-fix_ast_tools_visit_nested_objects_to_add___proto___nodeproto_in_raw_transfer_codegen branch from d760626 to be97ee1 Compare December 21, 2025 20:34
@overlookmotel overlookmotel force-pushed the om/12-20-feat_linter_plugins_implement_code_path_analysis_cfg_ branch from 6427333 to cc6d0cf Compare December 21, 2025 20:34
@overlookmotel overlookmotel self-assigned this Dec 21, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 21, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 21, 2025

Merge activity

… raw transfer codegen (#17230)

Fix a bug in codegen for ESTree walker, where it didn't visit nested objects when it adds `__proto__: NodeProto` to node objects. This doesn't make any difference now, but fixing it is required for next PR (#17231).
@graphite-app graphite-app bot force-pushed the om/12-20-feat_linter_plugins_implement_code_path_analysis_cfg_ branch from cc6d0cf to d913f87 Compare December 21, 2025 20:54
@graphite-app graphite-app bot requested a review from camc314 as a code owner December 21, 2025 20:54
@graphite-app graphite-app bot force-pushed the om/12-21-fix_ast_tools_visit_nested_objects_to_add___proto___nodeproto_in_raw_transfer_codegen branch from be97ee1 to 3d264cb Compare December 21, 2025 20:54
Base automatically changed from om/12-20-feat_linter_plugins_implement_code_path_analysis_cfg_ to main December 21, 2025 21:00
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 21, 2025
@graphite-app graphite-app bot merged commit 3d264cb into main Dec 21, 2025
19 checks passed
@graphite-app graphite-app bot deleted the om/12-21-fix_ast_tools_visit_nested_objects_to_add___proto___nodeproto_in_raw_transfer_codegen branch December 21, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants