From 01da2f78c1fbb4a56e43398d052b0f39f3f47bce Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:13:57 +0000 Subject: [PATCH] feat(codegen): print TSThisParameter for TSCallSignatureDeclaration and TSMethodSignature (#3792) --- crates/oxc_codegen/src/gen.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 34802d5fde919..4d4730d6bfd35 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -3055,6 +3055,13 @@ impl<'a, const MINIFY: bool> Gen 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 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 {