Skip to content

Commit 2e939b9

Browse files
committed
WTF
1 parent 70bda6a commit 2e939b9

File tree

1 file changed

+7
-0
lines changed
  • crates/swc_ecma_transforms_optimization/src/simplify/dce

1 file changed

+7
-0
lines changed

crates/swc_ecma_transforms_optimization/src/simplify/dce/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,13 @@ impl VisitMut for TreeShaker {
794794
self.in_block_stmt = old_in_block_stmt;
795795
}
796796

797+
fn visit_mut_block_stmt_or_expr(&mut self, n: &mut BlockStmtOrExpr) {
798+
let old_in_fn = self.in_fn;
799+
self.in_fn = true;
800+
n.visit_mut_children_with(self);
801+
self.in_fn = old_in_fn;
802+
}
803+
797804
fn visit_mut_class_members(&mut self, members: &mut Vec<ClassMember>) {
798805
self.visit_mut_par(cpu_count() * 8, members);
799806
}

0 commit comments

Comments
 (0)