SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 117 JavaScript

[rust-compiler] Fix SWC frontend directives, parenthesization, and as-const handling

Major fixes for SWC e2e test failures:

1. Directive handling: properly extract/inject directives in function bodies
   bidirectionally (SWC→Babel and Babel→SWC)
2. Expression parenthesization: wrap sequence, assignment, and nullish
   coalescing expressions in ParenExpr to prevent parse errors
3. TSConstAssertion: convert `as const` properly in both directions
4. Computed property keys: use PropName::Computed when computed flag is set
5. Arrow function bodies: parenthesize object expression bodies
6. E2E CLI: use TypeScript parser for all non-Flow files, return source
   directly when no compilation needed, error on compile failures

SWC e2e results: 1187 → 1599 passing.
J
Joe Savona committed
699a850af740b7c5c677057df2cf1e38fb8a1ec9
Parent: 14a056b