Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Sep 27, 2025

Compress

for (a of b) { c(); continue; }
for (a in b) { c(); continue; }

to

for (a of b) { c(); }
for (a in b) { c(); }

@github-actions github-actions bot added the A-minifier Area - Minifier label Sep 27, 2025
Copy link
Member Author


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.

@github-actions github-actions bot added the C-bug Category - Bug label Sep 27, 2025
@sapphi-red sapphi-red requested a review from Boshen September 27, 2025 13:05
@sapphi-red sapphi-red marked this pull request as ready for review September 27, 2025 13:06
Copilot AI review requested due to automatic review settings September 27, 2025 13:06
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

This PR fixes the JavaScript minifier to remove unnecessary continue statements at the end of for-in and for-of loop bodies, making the generated code more concise. The fix ensures that continue statements that would be the last statement executed in a loop iteration are removed since they have no effect.

Key changes:

  • Extended the condition to handle for-in and for-of loops in addition to regular for loops
  • Added test cases to verify the optimization works for all three loop types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 27, 2025

CodSpeed Instrumentation Performance Report

Merging #14186 will not alter performance

Comparing 09-27-fix_minifier_remove_continue_in_the_end_of_for-in___for-of (e4e963b) with main (353c001)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

  1. No successful run was found on main (353c001) during the generation of this report, so 353c001 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 4 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.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 1, 2025
Copy link
Member

Boshen commented Oct 1, 2025

Merge activity

Compress
```js
for (a of b) { c(); continue; }
for (a in b) { c(); continue; }
```
to
```js
for (a of b) { c(); }
for (a in b) { c(); }
```
@graphite-app graphite-app bot force-pushed the 09-27-fix_minifier_remove_continue_in_the_end_of_for-in___for-of branch from d038b54 to e4e963b Compare October 1, 2025 05:06
@graphite-app graphite-app bot merged commit e4e963b into main Oct 1, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 09-27-fix_minifier_remove_continue_in_the_end_of_for-in___for-of branch October 1, 2025 05:12
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 1, 2025
@Boshen Boshen mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants