mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(minifier): print decorators
This commit is contained in:
parent
e6737fdc48
commit
73b2a9a52b
1 changed files with 21 additions and 0 deletions
|
|
@ -528,6 +528,7 @@ impl<'a> Gen for FunctionBody<'a> {
|
|||
|
||||
impl<'a> Gen for FormalParameter<'a> {
|
||||
fn gen(&self, p: &mut Printer) {
|
||||
self.decorators.gen(p);
|
||||
self.pattern.gen(p);
|
||||
}
|
||||
}
|
||||
|
|
@ -1415,6 +1416,7 @@ impl Gen for MetaProperty {
|
|||
|
||||
impl<'a> Gen for Class<'a> {
|
||||
fn gen(&self, p: &mut Printer) {
|
||||
self.decorators.gen(p);
|
||||
p.print_str(b"class");
|
||||
if let Some(id) = &self.id {
|
||||
p.print(b' ');
|
||||
|
|
@ -1669,6 +1671,8 @@ impl<'a> Gen for StaticBlock<'a> {
|
|||
|
||||
impl<'a> Gen for MethodDefinition<'a> {
|
||||
fn gen(&self, p: &mut Printer) {
|
||||
self.decorators.gen(p);
|
||||
|
||||
if self.r#static {
|
||||
p.print_str(b"static ");
|
||||
}
|
||||
|
|
@ -1706,6 +1710,7 @@ impl<'a> Gen for MethodDefinition<'a> {
|
|||
|
||||
impl<'a> Gen for PropertyDefinition<'a> {
|
||||
fn gen(&self, p: &mut Printer) {
|
||||
self.decorators.gen(p);
|
||||
if self.r#static {
|
||||
p.print_str(b"static ");
|
||||
}
|
||||
|
|
@ -1822,3 +1827,19 @@ impl<'a> Gen for AssignmentPattern<'a> {
|
|||
self.right.gen(p);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Gen for Vec<'a, Decorator<'a>> {
|
||||
fn gen(&self, p: &mut Printer) {
|
||||
for decorator in self {
|
||||
decorator.gen(p);
|
||||
p.print(b' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Gen for Decorator<'a> {
|
||||
fn gen(&self, p: &mut Printer) {
|
||||
p.print(b'@');
|
||||
self.expression.gen(p);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue