feat(codegen): print TSThisParameter for TSCallSignatureDeclaration and TSMethodSignature (#3792)

This commit is contained in:
Dunqing 2024-06-20 10:13:57 +00:00
parent 2821e0e307
commit 01da2f78c1

View file

@ -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 {
@ -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 {