Skip to content

Commit

Permalink
abort on eval
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Dec 12, 2022
1 parent ce6e0c7 commit ac7dcb6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/swc_ecma_minifier/src/compress/optimize/iife.rs
Expand Up @@ -728,9 +728,9 @@ where
}
}

// If we has an eval, we cannot remap variables correctly.
let has_eval = contains_eval(body, false);
if !param_ids.is_empty() && has_eval {
// Abort on eval.
// See https://github.com/swc-project/swc/pull/6478
if contains_eval(body, false) {
log_abort!("iife: [x] Aborting because of eval");
return false;
}
Expand Down Expand Up @@ -761,10 +761,6 @@ where
}
) =>
{
if has_eval {
return false;
}

if var.decls.iter().any(|decl| match &decl.name {
Pat::Ident(BindingIdent {
id:
Expand Down

0 comments on commit ac7dcb6

Please sign in to comment.