Skip to content

Commit

Permalink
feat(codegen): print TSThisParameter for TSCallSignatureDeclaration a…
Browse files Browse the repository at this point in the history
…nd TSMethodSignature (#3792)
  • Loading branch information
Dunqing committed Jun 20, 2024
1 parent 2821e0e commit 01da2f7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3055,6 +3055,13 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for TSSignature<'a> {
}
Self::TSCallSignatureDeclaration(signature) => {
p.print_str(b"(");
if let Some(this_param) = &signature.this_param {
this_param.gen(p, ctx);
if !signature.params.is_empty() || signature.params.rest.is_some() {
p.print_str(b",");
}
p.print_soft_space();
}
signature.params.gen(p, ctx);
p.print_str(b")");
if let Some(return_type) = &signature.return_type {
Expand Down Expand Up @@ -3104,6 +3111,13 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for TSSignature<'a> {
type_parameters.gen(p, ctx);
}
p.print_str(b"(");
if let Some(this_param) = &signature.this_param {
this_param.gen(p, ctx);
if !signature.params.is_empty() || signature.params.rest.is_some() {
p.print_str(b",");
}
p.print_soft_space();
}
signature.params.gen(p, ctx);
p.print_str(b")");
if let Some(return_type) = &signature.return_type {
Expand Down

0 comments on commit 01da2f7

Please sign in to comment.