@@ -1454,6 +1454,8 @@ impl VisitMut for Optimizer<'_> {
1454
1454
1455
1455
#[ cfg_attr( feature = "debug" , tracing:: instrument( skip_all) ) ]
1456
1456
fn visit_mut_arrow_expr ( & mut self , n : & mut ArrowExpr ) {
1457
+ self . drop_unused_arrow_params ( & mut n. params ) ;
1458
+
1457
1459
let prepend = self . prepend_stmts . take ( ) ;
1458
1460
1459
1461
let ctx = self . ctx ;
@@ -1685,9 +1687,7 @@ impl VisitMut for Optimizer<'_> {
1685
1687
match n {
1686
1688
DefaultDecl :: Class ( _) => { }
1687
1689
DefaultDecl :: Fn ( f) => {
1688
- if !self . options . keep_fargs && self . options . unused {
1689
- self . drop_unused_params ( & mut f. function . params ) ;
1690
- }
1690
+ self . drop_unused_params ( & mut f. function . params ) ;
1691
1691
}
1692
1692
DefaultDecl :: TsInterfaceDecl ( _) => { }
1693
1693
}
@@ -1708,9 +1708,7 @@ impl VisitMut for Optimizer<'_> {
1708
1708
#[ cfg_attr( feature = "debug" , tracing:: instrument( skip_all) ) ]
1709
1709
fn visit_mut_export_decl ( & mut self , n : & mut ExportDecl ) {
1710
1710
if let Decl :: Fn ( f) = & mut n. decl {
1711
- if !self . options . keep_fargs && self . options . unused {
1712
- self . drop_unused_params ( & mut f. function . params ) ;
1713
- }
1711
+ self . drop_unused_params ( & mut f. function . params ) ;
1714
1712
}
1715
1713
1716
1714
let ctx = Ctx {
@@ -2027,9 +2025,7 @@ impl VisitMut for Optimizer<'_> {
2027
2025
. entry ( f. ident . to_id ( ) )
2028
2026
. or_insert_with ( || FnMetadata :: from ( & * f. function ) ) ;
2029
2027
2030
- if !self . options . keep_fargs && self . options . unused {
2031
- self . drop_unused_params ( & mut f. function . params ) ;
2032
- }
2028
+ self . drop_unused_params ( & mut f. function . params ) ;
2033
2029
2034
2030
let ctx = Ctx {
2035
2031
top_level : false ,
0 commit comments