mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
**Description:** Fixes JSX development transform output for shorthand fragments. Previously, JSX fragments transformed with `_jsxDEV` did not receive source metadata, so React dev tooling could not report the correct fragment location. This PR makes fragment `_jsxDEV` calls include the same source argument as JSX elements. It also reuses the existing `jsx_self` constructor guard through a shared `JsxSelfCtx`, so fragments only emit `this` as the self argument when it is safe. In derived class constructors, fragments now use `void 0`, matching the existing JSX element behavior. Added fixture coverage for: - JSX fragment source metadata regression from #11990 - fragment self handling inside derived class constructors Verified with: - `cargo fmt --all` - `cargo test -p swc_ecma_transforms_react` - `cargo test -p swc_ecma_transforms_react issue_11990 -- --ignored` - `cargo test -p swc_ecma_transforms_react jsxdev_fragment_derived_constructor -- --ignored` - `cargo clippy --all --all-targets -- -D warnings` **Related issue:** - Closes #11990