fix(transpiler): fix export default class crash and accessor ! parsing with decorators

Fix two bugs in ES decorator lowering:
1. `export default class` with decorators crashed because the code assumed
   the first statement from lowerClass was always s_class, but standard
   decorator lowering can produce prefix variable declarations.
2. `accessor field!: Type` (definite assignment assertion) failed to parse
   because the `!` operator was only recognized for `kind == .normal`,
   excluding `auto_accessor`.

Also fix DCE check panic on non-s_class statements in export default.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarred Sumner
2026-01-28 22:32:26 +01:00
parent 02d6a87305
commit 01311566ff
4 changed files with 169 additions and 11 deletions

View File

@@ -421,7 +421,7 @@ pub fn ParseProperty(
try p.lexer.next();
} else if (p.lexer.token == .t_exclamation and
!p.lexer.has_newline_before and
kind == .normal and
(kind == .normal or kind == .auto_accessor) and
!opts.is_async and
!opts.is_generator)
{