Skip to content

Commit

Permalink
Revert "eval!"
Browse files Browse the repository at this point in the history
This reverts commit 2630e7e.
  • Loading branch information
kdy1 committed Dec 15, 2022
1 parent 2630e7e commit 2d73ada
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/swc_ecma_minifier/src/compress/optimize/iife.rs
Expand Up @@ -15,7 +15,7 @@ use crate::debug::dump;
use crate::{
compress::optimize::{util::Remapper, Ctx},
mode::Mode,
util::{idents_captured_by, idents_used_by, make_number},
util::{contains_eval, idents_captured_by, idents_used_by, make_number},
};

/// Methods related to the option `negate_iife`.
Expand Down Expand Up @@ -730,11 +730,7 @@ where

// Abort on eval.
// See https://github.com/swc-project/swc/pull/6478
//
// We completetly abort on eval, because we cannot know whether a variable in
// upper scope will be afftected by eval.
// https://github.com/swc-project/swc/issues/6628
if self.data.top.has_eval_call {
if contains_eval(body, false) {
log_abort!("iife: [x] Aborting because of eval");
return false;
}
Expand Down

0 comments on commit 2d73ada

Please sign in to comment.