Skip to content

Commit 3baf4c9

Browse files
committed
repair if condition
1 parent 8ffeb76 commit 3baf4c9

File tree

1 file changed

+1
-7
lines changed
  • crates/swc_ecma_minifier/src/compress/optimize

1 file changed

+1
-7
lines changed

crates/swc_ecma_minifier/src/compress/optimize/evaluate.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,7 @@ impl Optimizer<'_> {
146146
..
147147
}) if matches!(obj.as_ref(), Expr::Ident(ident) if &*ident.sym == "Number") => {
148148
if let Expr::Ident(number_ident) = &**obj {
149-
if self
150-
.data
151-
.vars
152-
.get(&number_ident.to_id())
153-
.map(|var| var.flags.contains(VarUsageInfoFlags::DECLARED))
154-
.unwrap_or(false)
155-
{
149+
if number_ident.ctxt != self.ctx.expr_ctx.unresolved_ctxt {
156150
return;
157151
}
158152
}

0 commit comments

Comments
 (0)