Skip to content

Commit

Permalink
feat(codegen): print accessibility for MethodDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jun 15, 2024
1 parent ac90504 commit dba7980
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for MethodDefinition<'a> {
if self.r#type == MethodDefinitionType::TSAbstractMethodDefinition {
p.print_str(b"abstract ");
}

if let Some(accessibility) = &self.accessibility {
accessibility.gen(p, ctx);
}
if self.r#static {
p.print_str(b"static ");
}
Expand Down Expand Up @@ -2356,18 +2358,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for PropertyDefinition<'a> {
p.print_str(b"abstract ");
}
if let Some(accessibility) = &self.accessibility {
match accessibility {
TSAccessibility::Private => {
p.print_str(b"private ");
}
TSAccessibility::Protected => {
p.print_str(b"protected ");
}
TSAccessibility::Public => {
p.print_str(b"public ");
}
}
accessibility.gen(p, ctx);
}

if self.r#static {
p.print_str(b"static ");
}
Expand Down

0 comments on commit dba7980

Please sign in to comment.