swc-project
swc
BlogDocsChangelog

Branches performance

Pull requests

fix(es/compat): Preserve SyntaxContext in ES3 reserved word transformation#11330
last run
1 hour ago
fix(es/compat): Preserve SyntaxContext in ES3 reserved word transformation This commit improves the ES3 reserved word transformation pass to use the explicit `with_prefix` method when renaming identifiers, ensuring that the SyntaxContext field is preserved properly. ## Background The ES3 reserved word pass renames identifiers that are reserved in ES3 (like `char`, `byte`, `int`, etc.) by prefixing them with underscore to avoid conflicts in ES3 environments. Previously, the code directly modified the `sym` field: `i.sym = format!("_{}", i.sym).into()`. While this did preserve the `ctxt` field implicitly, it was not as explicit and clear as using the dedicated `with_prefix` method. ## Changes - Use `Ident::with_prefix("_")` instead of direct `sym` field modification - Add comprehensive test cases covering: - Multiple reserved words in exports (nextjs_issue_86076 test) - Mixed export syntax with function, const, and class - Multiple reserved words exported together - Variable declarations with reserved words ## Testing All existing tests pass, and new tests verify the transformation works correctly for various scenarios including the Next.js issue #86076 case. Related: vercel/next.js#86076 šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 hour ago
7b5ceeb
devbird/fix-es3-reserved-word-syntaxcontext
CodSpeed Performance Gauge
0%
chore(ci): Don't run claude code if there's no token#11329
last run
5 hours ago
only run claude code if there's token
5 hours ago
2e53fd9
CPunisher:11-25-chore/claude
CodSpeed Performance Gauge
0%
Create witty-olives-share.md
2 hours ago
ea61d97
CPunisher:11-25-fix/skip-block-comment
CodSpeed Performance Gauge
0%
Remove disallow_let
23 hours ago
3d0f7cc
CPunisher:11-24-refactor/ident
CodSpeed Performance Gauge
0%
Ā© 2025 CodSpeed Technology
Home Terms Privacy Docs