swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Optimizations
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(es/parser): Export `TokenFlags` from `unstable` (#12751) **Description:** The public `Tokens` trait uses `TokenFlags` in `update_token_flags` and `token_flags`. `TokenFlags` was private to the crate. Because of this, no crate outside the parser could implement `Tokens`. This PR exports `TokenFlags` from `swc_ecma_parser::unstable`, next to the other token types. It also adds an integration test. The test wraps `Lexer` in a `Tokens` implementation from outside the crate and parses a module with it. Local validation: `cargo test -p swc_ecma_parser` passed. `cargo test -p swc_ecma_parser --features unstable --test unstable_tokens` passed. `cargo clippy -p swc_ecma_parser --all-targets --features unstable -- -D warnings` passed. I did not run the workspace-wide `cargo clippy --all`. CI has not run yet. **BREAKING CHANGE:** None. **Related issue (if exists):** Closes #12747 Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
main
2 hours ago
fix(es/parser): Allow private brand checks in Flow mode (#12752) **Description:** Flow mode rejected every `#name` inside an expression. This also rejected the valid private brand check `#x in o`, which failed with `Expected an identifier`. Now Flow mode accepts `#name` only as the direct left operand of an `in` that binds tighter than the enclosing operator. This is the rule Babel uses. `#x;`, `(#x) in o`, `-#x in o` and `1 + #x in o` still error, so the Hermes behavior from #11699 is kept. Tests: new Flow fixtures cover the valid brand checks (`#x in o`, `o != null && #x in o`, `true == #x in o`) and the four invalid positions. I ran `cargo test -p swc_ecma_parser --all-features` (all passed, including the Hermes parity tests), `cargo fmt --all` and `cargo clippy -p swc_ecma_parser --all-targets --all-features -- -D warnings` (clean) on the final code. I did not run the workspace-wide clippy. **BREAKING CHANGE:** None. **Related issue (if exists):** Closes #12748 --------- Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
main
2 hours ago
fix(es/parser): Export `TokenFlags` from `unstable` The public `Tokens` trait uses `TokenFlags` in `update_token_flags` and `token_flags`, but the type was private. Crates outside the parser could not implement `Tokens`. Export it from `swc_ecma_parser::unstable` next to the other token types. Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12747
3 hours ago
Merge branch 'main' into perf/minifier-pure-traversal
perf/minifier-pure-traversal
3 hours ago
chore: Add changeset Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12748
3 hours ago
fix(es/parser): Allow top-level `for await` in Flow modules The Flow-only `for await` check in `parse_for_stmt` also ran under `parse_module`, so `for await (const x of y) {}` at the top level of a module failed to parse. Top-level await makes this valid in modules, so skip the check when the module context is active. Scripts, regular functions and static blocks still report an error. Fixes #12749 Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12749
3 hours ago
Merge branch 'main' into fix/minifier-import-live-bindings
fix/minifier-import-live-bindings
3 hours ago
docs: add combined native and btrfs benchmark results
jdalton:perf/native-btrfs-codec-fallback
8 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
fix(es/parser): Export `TokenFlags` from `unstable`
#12751
3 hours ago
e432385
kdy1/fix-issue-12747
CodSpeed Performance Gauge
0%
perf(es/minifier): Avoid repeated simplification of unused values
#12736
3 hours ago
18870ae
perf/minifier-pure-traversal
CodSpeed Performance Gauge
+4%
fix(es/parser): Allow private brand checks in Flow mode
#12752
3 hours ago
8d17bf2
kdy1/fix-issue-12748
Ā© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs