mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
**Description:**
Fixes a legacy decorator metadata panic when a decorated TypeScript
member uses an inline import type such as `import("./Message").Message`.
The metadata serializer now treats `TsImportType` as an unresolvable
transpile-only type and emits `Object`, matching TypeScript's runtime
metadata behavior. The catch-all serializer path also falls back to
`Object` instead of panicking on well-formed TS type nodes, and bigint
literal metadata now follows the existing `BigInt` constructor fallback.
Added legacy metadata fixtures for import types on properties, methods,
constructors, parenthesized/generic/union/intersection forms, and bigint
literal metadata.
Validation:
- `git submodule update --init --recursive`
- `UPDATE=1 cargo test -p swc_ecma_transforms --all-features --test
decorators
legacy_metadata_tests__fixture__legacy_metadata__issues__11915 --
--include-ignored`
- `cargo test -p swc_ecma_transforms --all-features --test decorators
legacy_metadata_tests__fixture__legacy_metadata__issues__11915 --
--include-ignored`
- `cargo test -p swc_ecma_transforms --all-features --test decorators
legacy_metadata_tests -- --include-ignored`
- `cargo test -p swc_ecma_transforms_proposal`
- `cargo test -p swc_ecma_transforms`
- `cargo fmt --all`
- `cargo clippy --all --all-targets -- -D warnings`
Note: `cargo test -p swc_ecma_transforms --all-features` was also
attempted locally, but exec tests requiring `mocha` could not run
because `mocha` is not installed on PATH in this environment.
**Related issue:**
Closes #11915