fix(ast_tools): visit nested objects to add __proto__: NodeProto in raw transfer codegen#17230
Conversation
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. |
There was a problem hiding this comment.
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_expressioncall to recursively visit nested object expressions - Imported
walk_mutfromoxc_ast_visitto enable the recursive walking functionality
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d760626 to
be97ee1
Compare
6427333 to
cc6d0cf
Compare
Merge activity
|
cc6d0cf to
d913f87
Compare
be97ee1 to
3d264cb
Compare

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