Skip to content

fix(minifier): remove continue in for-in / for-of#14151

Merged
sapphi-red merged 3 commits intooxc-project:mainfrom
daflyinbed:fix_continue
Sep 27, 2025
Merged

fix(minifier): remove continue in for-in / for-of#14151
sapphi-red merged 3 commits intooxc-project:mainfrom
daflyinbed:fix_continue

Conversation

@daflyinbed
Copy link
Contributor

fix: #14063

Copilot AI review requested due to automatic review settings September 26, 2025 10:51
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 26, 2025

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.

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 an issue with continue statement optimization by expanding the scope to include for-in and for-of loops in addition to regular for loops. The optimization transforms conditional continue statements into logical expressions for better minification.

  • Expands continue statement optimization to handle for-in and for-of loops
  • Adds comprehensive test coverage for all three types of for loops

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

@github-actions github-actions bot added the A-minifier Area - Minifier label Sep 26, 2025
@daflyinbed daflyinbed changed the title fix: remove continue fix(minifier): remove continue Sep 26, 2025
@github-actions github-actions bot added the C-bug Category - Bug label Sep 26, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 26, 2025

CodSpeed Instrumentation Performance Report

Merging #14151 will not alter performance

Comparing daflyinbed:fix_continue (4664d9e) with main (aa927ab)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

  1. No successful run was found on main (e9a14d1) during the generation of this report, so aa927ab 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.

@overlookmotel
Copy link
Member

overlookmotel commented Sep 26, 2025

Thanks for tackling this.

Quick note: Run just allocs and just minsize locally to update the snapshot files, which will fix the CI fails.

@overlookmotel
Copy link
Member

overlookmotel commented Sep 27, 2025

We've recently merged changes to the allocs snapshot. Could you please rebase on latest main and re-run just allocs and just minsize again? That should fix merge conflicts.

Sorry! Oxc moves pretty fast and it's hard to avoid merge conflicts.

@daflyinbed
Copy link
Contributor Author

updated

Signed-off-by: 翠 <green@sapphi.red>
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@sapphi-red sapphi-red changed the title fix(minifier): remove continue fix(minifier): remove continue in for-in / for-of Sep 27, 2025
@sapphi-red sapphi-red merged commit 358f2fc into oxc-project:main Sep 27, 2025
27 checks passed
@daflyinbed daflyinbed deleted the fix_continue branch September 30, 2025 08:44
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.

minifier: Remove continue statements

4 participants