Skip to content

Commit

Permalink
refactor(es/minifier): Remove unnecessary check (#8927)
Browse files Browse the repository at this point in the history
  • Loading branch information
Austaras committed May 7, 2024
1 parent 8654a34 commit 8932a1b
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions crates/swc_ecma_minifier/src/compress/optimize/iife.rs
Expand Up @@ -751,18 +751,6 @@ impl Optimizer<'_> {
}
}

// We should not add a variable to top level scope if the user has disabled it.
//
// See https://github.com/swc-project/swc/issues/8909
if !self.options.top_level() && self.ctx.in_top_level() {
for s in body.stmts.iter() {
if let Stmt::Decl(Decl::Var(..)) = s {
log_abort!("iife: [x] Cannot inline because of top level scope");
return false;
}
}
}

if !body.stmts.iter().all(|stmt| match stmt {
Stmt::Decl(Decl::Var(var))
if matches!(
Expand Down

0 comments on commit 8932a1b

Please sign in to comment.