File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
crates/swc_ecma_minifier/src/compress/optimize Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -646,11 +646,17 @@ impl Optimizer<'_> {
646
646
. iter ( )
647
647
. map ( |p| & p. pat . as_ident ( ) . unwrap ( ) . id ) ;
648
648
649
+ #[ cfg( feature = "debug" ) ]
650
+ let param_ids_for_debug = param_ids. clone ( ) ;
651
+
649
652
let new =
650
653
self . inline_fn_like ( param_ids, f. function . params . len ( ) , body, & mut call. args ) ;
651
654
if let Some ( new) = new {
652
655
self . changed = true ;
653
- report_change ! ( "inline: Inlining a function call (params = {param_ids:?})" ) ;
656
+ report_change ! (
657
+ "inline: Inlining a function call (params = {:?})" ,
658
+ param_ids_for_debug
659
+ ) ;
654
660
655
661
dump_change_detail ! ( "{}" , dump( & new, false ) ) ;
656
662
@@ -1152,7 +1158,7 @@ impl Optimizer<'_> {
1152
1158
1153
1159
fn inline_fn_like_stmt < ' a > (
1154
1160
& mut self ,
1155
- params : impl Iterator < Item = & ' a Ident > + Clone ,
1161
+ params : impl Iterator < Item = & ' a Ident > + Clone + std :: fmt :: Debug ,
1156
1162
params_len : usize ,
1157
1163
body : & mut BlockStmt ,
1158
1164
args : & mut [ ExprOrSpread ] ,
Original file line number Diff line number Diff line change @@ -805,7 +805,7 @@ impl Optimizer<'_> {
805
805
}
806
806
807
807
match & decl {
808
- Decl :: Class ( _ ) => {
808
+ Decl :: Class ( _c ) => {
809
809
if self . options . inline != 3
810
810
|| self . options . keep_classnames
811
811
|| self . mangle_options . is_some_and ( |v| v. keep_class_names )
@@ -817,11 +817,11 @@ impl Optimizer<'_> {
817
817
self . changed = true ;
818
818
report_change ! (
819
819
"inline: Decided to inline class `{}{:?}` as it's used only once" ,
820
- c . ident. sym,
821
- c . ident. ctxt
820
+ _c . ident. sym,
821
+ _c . ident. ctxt
822
822
) ;
823
823
}
824
- Decl :: Fn ( _ ) => {
824
+ Decl :: Fn ( _f ) => {
825
825
if self . options . keep_fnames
826
826
|| self . mangle_options . is_some_and ( |v| v. keep_fn_names )
827
827
{
@@ -832,8 +832,8 @@ impl Optimizer<'_> {
832
832
self . changed = true ;
833
833
report_change ! (
834
834
"inline: Decided to inline function `{}{:?}` as it's used only once" ,
835
- f . ident. sym,
836
- f . ident. ctxt
835
+ _f . ident. sym,
836
+ _f . ident. ctxt
837
837
) ;
838
838
}
839
839
_ => { }
You can’t perform that action at this time.
0 commit comments