swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(es/typescript): Do not treat `declare global` as a namespace `declare global {}` augments the global scope: its members are bare bindings, not properties of an object named `global`. The ambient walk registered them under the `global` identifier, and since a user binding by that name shares its `Id`, `enum E { A = global.g }` folded into the augmentation. `tsc` and `main` leave that read alone. Also cover qualified reads of a namespace from inside its own body, a `declare enum` inside a concrete namespace, and namespace member folding under `tsEnumIsMutable`, which all already behaved correctly but had no test.
baltasarblanco:fix/12102-namespace-member-fold
19 minutes ago
fix(es/typescript): Restrict namespace paths to identifier segments `static_enum_member_name` accepts computed string and template properties, which is right for an enum member but not for a namespace path: `tsc` leaves `N["I"].x` for runtime evaluation. Reading it through the same extractor made the fold apply to element access as well, both on the traversal and on the final property. Add a separate extractor for path segments that only accepts identifiers, and use it in both places. The enum member lookup keeps the original one, so `E["A"]` is unaffected.
baltasarblanco:fix/12102-namespace-member-fold
33 minutes ago
fix(es/typescript): Keep namespace resolution out of the recompute pass Namespace-qualified reads resolved through the completed member map during `EvalCtx::RECOMPUTE`, so an enum reading a namespace declared after it folded to a value that is not visible at that point. Gate the resolution on `allow_const_var`, like a bare `const` reference. Track ambient namespace bodies separately from `skip_transform_info`, which is also set for a single erased declaration inside a concrete namespace: such a binding is not a member of it and has no runtime property.
baltasarblanco:fix/12102-namespace-member-fold
57 minutes ago
chore: Add changeset
baltasarblanco:fix/12102-namespace-member-fold
3 hours ago
fix(es/minifier): preserve local join coercion
fix/minifier-constant-join-3
5 hours ago
fix(es/minifier): preserve arrow and import join coercion
fix/minifier-constant-join-3
5 hours ago
fix(es/minifier): preserve nested call join coercion
fix/minifier-constant-join-3
6 hours ago
fix(es/minifier): preserve additional join coercions
fix/minifier-constant-join-3
6 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
fix(es/typescript): Fold namespace-qualified enum member reads
#12290
22 minutes ago
c6ce4c2
baltasarblanco:fix/12102-namespace-member-fold
CodSpeed Performance Gauge
0%
fix(es/minifier): preserve string coercion in array join folding
#12279
5 hours ago
6687b4e
fix/minifier-constant-join-3
CodSpeed Performance Gauge
0%
mod(es/minifier): Check Map/Set param is array
#12287
16 hours ago
d3e1467
Austaras:iter
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs