mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user