mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
fix(es/compat): Handle export default decorator only if not empty (#8099)
**Related issue:** - Closes: #8098
This commit is contained in:
parent
3dc761ab47
commit
bf523f5351
@ -1449,7 +1449,7 @@ impl VisitMut for Decorator202203 {
|
|||||||
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl {
|
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl {
|
||||||
span: _,
|
span: _,
|
||||||
decl: DefaultDecl::Class(c),
|
decl: DefaultDecl::Class(c),
|
||||||
})) => {
|
})) if !c.class.decorators.is_empty() => {
|
||||||
self.handle_class_expr(&mut c.class, c.ident.as_ref());
|
self.handle_class_expr(&mut c.class, c.ident.as_ref());
|
||||||
s.visit_mut_children_with(self);
|
s.visit_mut_children_with(self);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
export default class T {}
|
@ -0,0 +1,2 @@
|
|||||||
|
export default class T {
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"plugins": [["proposal-decorators", { "version": "2022-03" }]]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user