Skip to content

Commit a6cabcd

Browse files
authored
Merge 68c230d into fd938d3
2 parents fd938d3 + 68c230d commit a6cabcd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

crates/oxc_codegen/src/gen.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,13 @@ impl Gen for ObjectProperty<'_> {
16401640
type_parameters.print(p, ctx);
16411641
}
16421642
p.print_ascii_byte(b'(');
1643+
if let Some(this_param) = &func.this_param {
1644+
this_param.print(p, ctx);
1645+
if !func.params.is_empty() || func.params.rest.is_some() {
1646+
p.print_ascii_byte(b',');
1647+
p.print_soft_space();
1648+
}
1649+
}
16431650
func.params.print(p, ctx);
16441651
p.print_ascii_byte(b')');
16451652
if let Some(return_type) = &func.return_type {

crates/oxc_codegen/tests/integration/ts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::{
88
#[test]
99
fn cases() {
1010
test_same("({ foo(): string {} });\n");
11+
test_same("({ method(this: Foo): void {} });\n");
1112
test_same("interface I<in out T,> {}\n");
1213
test_same("function F<const in out T,>() {}\n");
1314
test_same("class C {\n\tp = await(0);\n}\n");

0 commit comments

Comments
 (0)