Skip to content

[pull] main from facebook:main#355

Merged
pull[bot] merged 1 commit into
LoadsAForks:mainfrom
react:main
Dec 11, 2025
Merged

[pull] main from facebook:main#355
pull[bot] merged 1 commit into
LoadsAForks:mainfrom
react:main

Conversation

@pull

@pull pull Bot commented Dec 11, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

### What
Fixes source locations for VariableDeclarator in the generated AST.
Fixes a number of the errors in the snapshot I added yesterday in the
source loc validator PR #35109

I'm not entirely sure why, but a side effect of the fix has resulted in
a ton of snaps needing updating, with some empty lines no longer present
in the generated output. I broke the change up into 2 separate commits.
The [first
commit](f4e4dc0)
has the core change and the update to the missing source locations test
expectation, and the [second
commit](cd4d9e9)
has the rest of the snapshot updates.

### How
- Add location for variable declarators in ast codegen.
- We don't actually have the location preserved in HIR, since when we
lower the declarations we pass through the location for the
VariableDeclaration. Since VariableDeclarator is just a container for
each of the assignments, the start of the `id` and end of the `init` can
be used to accurately reconstruct it when generating the AST.
- Add source locations for object/array patterns for destructuring
assignment source location support
@pull pull Bot locked and limited conversation to collaborators Dec 11, 2025
@pull pull Bot added the ⤵️ pull label Dec 11, 2025
@pull
pull Bot merged commit d3eb566 into LoadsAForks:main Dec 11, 2025
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant