feat(minifier): store symbol information for for init variables#13507
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 refactors how for statement initializer variables are handled in the minifier by moving the logic from symbol-level tracking to more targeted transformation-specific checks.
- Removes the
for_statement_initfield fromSymbolValuestruct - Implements local checks for for statement context in transformations that need it
- Updates affected optimizations to use the new approach
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_minifier/src/symbol_value.rs | Removes for_statement_init field from SymbolValue struct |
| crates/oxc_minifier/src/ctx.rs | Removes for statement initialization logic and field assignment |
| crates/oxc_minifier/src/peephole/inline.rs | Adds local is_for_statement_init function and updates value initialization logic |
| crates/oxc_minifier/src/peephole/remove_unused_expression.rs | Removes for statement check and adds new test cases |
| tasks/track_memory_allocations/allocs_minifier.snap | Updates memory allocation snapshots |
| tasks/minsize/minsize.snap | Updates minification size snapshots |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13507 will not alter performanceComparing Summary
Footnotes |
Merge activity
|
Store the symbol information for "for init variables" so that the transformation that relies on it can use it.
cc81738 to
b4dfddd
Compare

Store the symbol information for "for init variables" so that the transformation that relies on it can use it.