File tree 1 file changed +0
-24
lines changed
crates/swc_ecma_transforms_optimization/src
1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -157,12 +157,6 @@ impl DeadCodeEliminator {
157
157
var. scope = scope;
158
158
var. has_side_effects = has_side_effects;
159
159
var. is_fn = is_fn;
160
-
161
- // Only mark changed if there's an actual difference in behavior
162
- // that might affect code elimination
163
- if prev_has_side_effects != has_side_effects || prev_is_fn != is_fn {
164
- self . changed = true ;
165
- }
166
160
}
167
161
168
162
/// Evaluate if expression is pure (no side effects)
@@ -512,24 +506,6 @@ impl VisitMut for DeadCodeEliminator {
512
506
if removed_any && original_count != import_decl. specifiers . len ( ) {
513
507
self . changed = true ;
514
508
}
515
-
516
- // If we removed all specifiers but there were some originally,
517
- // keep one to maintain a valid import statement
518
- if original_count > 0 && import_decl. specifiers . is_empty ( ) {
519
- import_decl
520
- . specifiers
521
- . push ( ImportSpecifier :: Named ( ImportNamedSpecifier {
522
- span : DUMMY_SP ,
523
- local : Ident {
524
- span : DUMMY_SP ,
525
- sym : "_unused" . into ( ) ,
526
- ctxt : self . ctx ,
527
- optional : false ,
528
- } ,
529
- imported : None ,
530
- is_type_only : false ,
531
- } ) ) ;
532
- }
533
509
}
534
510
_ => { }
535
511
}
You can’t perform that action at this time.
0 commit comments