Skip to content

Conversation

@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

🦋 Changeset detected

Latest commit: 51ca02a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Nov 30, 2025

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31873608 bytes)

Commit: f0d9ac3

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 30, 2025

CodSpeed Performance Report

Merging #11339 will not alter performance

Comparing magic-akari:fix/generator (51ca02a) with main (b6ad2cb)

Summary

✅ 138 untouched

@magic-akari magic-akari marked this pull request as ready for review November 30, 2025 12:03
@magic-akari magic-akari requested a review from a team as a code owner November 30, 2025 12:03
Copilot AI review requested due to automatic review settings November 30, 2025 12:03
@magic-akari magic-akari requested a review from a team as a code owner November 30, 2025 12:03
Copilot finished reviewing on behalf of magic-akari November 30, 2025 12:05
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 critical bugs in the ES2015 generator transform for compound assignments, for-in loops, and labeled break statements. The changes ensure proper code generation when these constructs are used with generators and async functions that are compiled to ES5.

Key changes:

  • Fixed compound assignments with yield expressions to properly cache the left-hand side value before evaluation
  • Enhanced for-in loop transformation to handle property deletion during iteration
  • Corrected labeled break statement resolution to only match LabeledBlocks

Reviewed changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/swc_ecma_compat_es2015/src/generator.rs Core fix for compound assignments, for-in loops, and labeled break handling
crates/swc_ecma_transforms_base/src/helpers/_ts_generator.js Updated generator helper to use Object.defineProperty for better compatibility
packages/helpers/esm/_ts_generator.js Forked version of _ts_generator helper with Object.defineProperty
packages/helpers/scripts/ast_grep.js Updated build script to exclude forked _ts_generator from tslib import rewriting
packages/helpers/.dprint.json Excluded _ts_generator files from formatting
Multiple test files Added comprehensive test cases for all fixed issues

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kdy1 kdy1 added this to the Planned milestone Nov 30, 2025
@kdy1
Copy link
Member

kdy1 commented Nov 30, 2025

Wow... I'll review your PRs after the trip. Sorry for the delay.

@kdy1 kdy1 merged commit 9b6bedd into swc-project:main Dec 3, 2025
22 checks passed
@magic-akari magic-akari deleted the fix/generator branch December 3, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment