refactor(estree/tokens): reduce repeated code#19857
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 1, 2026
Merged
Conversation
This was referenced Feb 28, 2026
Member
Author
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors ESTree token serialization to centralize UTF-8 → UTF-16 span conversion logic, reducing duplication while preserving existing serialization behavior.
Changes:
- Extracted repeated span conversion logic into a new
get_utf16_spanhelper. - Updated safe/unsafe token serialization paths and RegExp token serialization to use the helper.
- Clarified
advance_tobehavior via an additional doc comment.
Member
Author
Merge activity
|
Pure refactor. Move code for converting a span from UTF-8 to UTF-16 into its own function, instead of having the same code in 3 places.
efbb82b to
c4852cd
Compare
f4a1906 to
a2de704
Compare
Base automatically changed from
om/02-24-ci_benchmarks_add_benchmark_for_updating_tokens_for_raw_transfer
to
main
March 1, 2026 08:11
This was referenced Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pure refactor. Move code for converting a span from UTF-8 to UTF-16 into its own function, instead of having the same code in 3 places.