swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(es/compat): rewrite this in destructuring defaults (#11909) ## Summary Fix async-to-generator so `this` inside destructuring defaults in async arrow class fields is rewritten to the hoisted `_this` binding. ## Origin issue case Repro playground case: https://play.swc.rs/?version=1.15.40&code=H4sIAAAAAAAAA61Uy27bMBC8%2BysWvkRCa6Up0IuNBGgSt02bxkWc9Box0spmI5EuScU2DAP9iH5hv6RDKrLzQk7RxTC5Ozs7O9yd2jJZZ2Tmdga0u0uGRUmVzuuSLQnTXlI0HH%2BPB%2BSm4UQsKXVTaVO65kxXCE1rlXMhFecp7R8gzui57QBw%2FxU%2Fj2fnGaWGZ6XI%2BMpzuJLqihczAy71hP79%2BdtSk8rKnElQzqBcZ642Uk3wrxB16UgXJJRHFHapMvQKxnR0%2BnE8pk8nw9Nj5CP3eHh%2B8nN4TFkprCVp6Wx0AZHmRjrHipymNLBIEw91Xqsg0XUtyxyQThYC4uXScObKJc2lm1KqdM6pT0UbBlJnHJIuljMegoXxUAGNf9fItHQ4uvhCUF3ZQpsKc8mcvOW%2BjyHqbW96oZWe070JKzbCafM0JnTSQ%2BEZgx%2FQiSJOJgn9slnihJmw61OX7ft3ex%2B68auPsBHyUMB3qw6RZTd2wnG0iGkFQTAkRYsBrTvrThuLsfICauf383wS7SPnVpQ192mP1gOcg%2B7h5ed%2B44EkRHknBIGf9wFilrb1TNQ7oI2TSTgytXKy4hjQFbupzlGzMUw0E0ZUsXe7J0SUaWUdCLXUtgxojb8hfBAi79psAloBQiSeWOjBX5FWTCdj4Jo7%2BzzwXbAd4ND2RqrRzSOl6N4HWFB0Rpf9tl2tgBp8rmANvPxAomLlCEJsy42%2BvSD5Y12eSGIfiPGSBPFg0xDY9vwHh5RFD2NQfmjti3FSq%2Ba%2B01QtatUcVkIqUPD1m%2Br6xlObC%2BlI8RwSRXHSUI5COR%2BlS05KPYm6dwIRwjZB%2Fv0cdN%2FS1%2FHoLPHrUE1ksYz0TdxOa9UNinT7e2sAOrN80L55UB9u3hJYrTcQa6%2Fa8w4twhLY9wMRmOxWyk2RDX%2Bg38O%2BUxlOjs5G%2Fl3E%2Fad9mLhRnTLhsil2QXyPvQdmv5Oi7vnwx%2Fno%2BPIIyzDIwUloz9PFylKiYnpDXawO%2FDBIWCsmHDfTxtAyHCS8kO4I2w%2BK7IWimHQzsEHnP2LBffKLBgAA&config=H4sIAAAAAAAAA02OSQ7CMAxF95yiyrqRgAUL7sAJEAsrdUtRJtkuoqp6dzJQIIvI%2Fnn5esuuSUc92KhzszQqAjFSnXn2Aq80KzQO2NAYRbUZzmEPlrFZ025DYPxLaqUL3WSxNskcsfTwSX2BkS8bIjThJ0X%2FzH%2FKkiFv7NRl5qqEwHMfyGlIakZL0AN6JJBA2ev3biww60ghIsmIrG7tVihAAwpXL3On4IrZ4bhPZgXK9%2FoGBgwLNRgBAAA%3D ## Root cause When the async arrow body is moved into a generator function, the constructor-context `this` rewrite only walked initializer expressions. It skipped binding-pattern defaults inside variable declarators, so nested `this` references survived and became `undefined` at runtime. ## Validation - `git submodule update --init --recursive` - `cargo fmt --all` - `cargo test -p swc_ecma_transformer` - `cargo test -p swc_ecma_transforms_compat` - `cargo clippy --all --all-targets -- -D warnings`
main
9 hours ago
chore: add changeset
hardfist:perf/optimize-atom-eq
10 hours ago
fix(plugin): avoid importing __free from env (#11908) **Description:** - Treat `__free` in plugin memory interop as the linked allocator symbol from `swc_plugin::allocation`, not an `env` host import. - Stop injecting `env::__free` from the Wasm plugin runtime import object. - This fixes the regression from swc-project/swc#11783 where `__free` was accidentally treated like a dynamic host import. **Related issue:** Related to swc-project/swc#11783. - Closes https://github.com/swc-project/swc/issues/11907
main
1 day ago
Create light-eagles-wish.md
kdy1/fix-free-wasm-import
1 day ago
fix(encoding): Fix incorrect items count
quininer:x/fix-encoding-count
1 day ago
refactor(plugin): remove explicit env wasm import module
kdy1/remove-wasm-env-link
1 day ago
fix(encoding): Fix incorrect items count
quininer:x/fix-encoding-count
1 day ago
fix(swc): preserve plugin error context (#11904) **Description:** Preserve the full `anyhow` context chain when reporting SWC Wasm plugin transform failures. Previously plugin errors were reported with `err.to_string()`, which only retained the outermost context. This made ABI/runtime failures hard to diagnose because the diagnostic that reaches consumers such as Rspack could stop at `failed to invoke plugin on ...`. This now reports plugin errors with `format!("{err:#}")`, so the compact context chain is preserved. **Error report comparison:** For a plugin instantiation failure caused by a missing `env.__free` import: Before: ```text failed to invoke plugin on 'Some("src/index.jsx")' ``` After: ```text failed to invoke plugin on 'Some("src/index.jsx")': failed to invoke `@swc/plugin-remove-console` as js transform plugin at @swc/plugin-remove-console: unknown import: `env::__free` has not been defined ```
main
1 day ago
Latest Branches
CodSpeed Performance Gauge
0%
fix(es/compat): rewrite this in destructuring defaults
#11909
10 hours ago
b901c7b
hardfist:perf/optimize-atom-eq
CodSpeed Performance Gauge
0%
fix(plugin): avoid importing __free from env
#11908
1 day ago
b3ed437
kdy1/fix-free-wasm-import
CodSpeed Performance Gauge
0%
fix(encoding): Fix incorrect fields count
#11905
1 day ago
013d364
quininer:x/fix-encoding-count
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs