File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use crate::{
88#[ test]
99fn 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 \t p = await(0);\n }\n " ) ;
You can’t perform that action at this time.
0 commit comments