mirror of
https://github.com/swc-project/swc.git
synced 2024-11-27 13:38:33 +03:00
refactor(es/minifier): Remove unnecessary check (#8927)
This commit is contained in:
parent
8654a34385
commit
8932a1b527
@ -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!(
|
||||
|
Loading…
Reference in New Issue
Block a user