feat(minifier): support more statements for single use variable inlining#13277
Merged
graphite-app[bot] merged 1 commit intomainfrom Aug 24, 2025
Conversation
This was referenced Aug 24, 2025
Merged
Member
Author
CodSpeed Instrumentation Performance ReportMerging #13277 will degrade performances by 7.21%Comparing Summary
Benchmarks breakdown
Footnotes |
b70e401 to
62e38f5
Compare
1dac1a4 to
17cf2c7
Compare
17cf2c7 to
45df7a8
Compare
95082cd to
da5d1f9
Compare
45df7a8 to
9e407ff
Compare
This was referenced Aug 24, 2025
Contributor
Merge activity
|
…ing (#13277) Added `substitute_single_use_symbol_in_statement` calls to other statements like esbuild does.
da5d1f9 to
dcda3a2
Compare
9e407ff to
a951eee
Compare
Base automatically changed from
08-24-feat_minifier_support_more_expressions_for_single_use_variable_inlining
to
main
August 24, 2025 08:53
graphite-app bot
pushed a commit
that referenced
this pull request
Sep 14, 2025
#13755) Inline single use variables in for statements: ```js function wrapper1() { var x = foo; for (var i = x; i < 10; i++) console.log(i) } function wrapper2() { var i, x = foo; for (i = x; i < 10; i++) console.log(i) } // to function wrapper1() { for (var i = foo; i < 10; i++) console.log(i) } function wrapper2() { var i; for (i = foo; i < 10; i++) console.log(i) } ``` ```js function wrapper() { var x = {}; for (var a in x) console.log(a) } // to function wrapper() { for (var a in {}) console.log(a) } ``` ```js function wrapper() { var x = []; for (var a of x) console.log(a) } // to function wrapper() { for (var a of []) console.log(a) } ``` refs #13277
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.

Added
substitute_single_use_symbol_in_statementcalls to other statements like esbuild does.