fix(estree): handle empty spans serializing ImportMeta and NewTarget#24775
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. |
c4284d7 to
35ae343
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR hardens ESTree serialization/deserialization for the recently introduced ImportMeta and NewTarget AST nodes by correctly handling the “empty span” case (SPAN), which can occur when nodes are synthesized during transforms and later serialized.
Changes:
- Update ESTree serialization of
ImportMeta/NewTargetidentifier subfields to avoid manufacturing non-empty spans when the node span isSPAN. - Update the associated
raw_desersnippets to avoid deriving offsets from empty spans. - Import
SPANinto the serializer module to enable explicit empty-span checks.
7d185b5 to
b287f29
Compare
35ae343 to
a18c4bc
Compare
a18c4bc to
fc31e79
Compare
359519f to
6ab74a7
Compare
Merge activity
|
6ab74a7 to
e80574f
Compare

Follow-on after #24557. Handle when
ImportMeta/NewTargethas an empty span (SPAN). This code path is not exercised at present, but it seems a good idea to be prepared for when we may serialize AST after transformation.