Skip to content

refactor(estree/tokens): reduce repeated code#19857

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-28-refactor_estree_tokens_reduce_repeated_code
Mar 1, 2026
Merged

refactor(estree/tokens): reduce repeated code#19857
graphite-app[bot] merged 1 commit intomainfrom
om/02-28-refactor_estree_tokens_reduce_repeated_code

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 28, 2026

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.

Copy link
Member Author

overlookmotel commented Feb 28, 2026


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.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 28, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/02-28-refactor_estree_tokens_reduce_repeated_code (f4a1906) with om/02-24-ci_benchmarks_add_benchmark_for_updating_tokens_for_raw_transfer (efbb82b)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel marked this pull request as ready for review March 1, 2026 07:03
Copilot AI review requested due to automatic review settings March 1, 2026 07:03
@overlookmotel overlookmotel self-assigned this Mar 1, 2026
@overlookmotel overlookmotel added A-parser Area - Parser A-linter-plugins Area - Linter JS plugins labels Mar 1, 2026
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

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_span helper.
  • Updated safe/unsafe token serialization paths and RegExp token serialization to use the helper.
  • Clarified advance_to behavior via an additional doc comment.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
Copy link
Member Author

overlookmotel commented Mar 1, 2026

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.
@graphite-app graphite-app bot force-pushed the om/02-24-ci_benchmarks_add_benchmark_for_updating_tokens_for_raw_transfer branch from efbb82b to c4852cd Compare March 1, 2026 08:04
@graphite-app graphite-app bot force-pushed the om/02-28-refactor_estree_tokens_reduce_repeated_code branch from f4a1906 to a2de704 Compare March 1, 2026 08:05
Base automatically changed from om/02-24-ci_benchmarks_add_benchmark_for_updating_tokens_for_raw_transfer to main March 1, 2026 08:11
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 1, 2026
@graphite-app graphite-app bot merged commit a2de704 into main Mar 1, 2026
22 checks passed
@graphite-app graphite-app bot deleted the om/02-28-refactor_estree_tokens_reduce_repeated_code branch March 1, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter-plugins Area - Linter JS plugins A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants