Skip to content

Commit

Permalink
Make top_retain correct
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Feb 2, 2024
1 parent c46ec43 commit e094f8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/swc_ecma_minifier/src/compress/optimize/sequences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,9 @@ impl Optimizer<'_> {
// Respect top_retain
if let Some(a_id) = a.id() {
if a_id.0 == "arguments"
|| (self.ctx.in_top_level() && self.options.top_retain.contains(&a_id.0))
|| (self.ctx.in_top_level()
&& a_id.1 == self.marks.top_level_ctxt
&& self.options.top_retain.contains(&a_id.0))
{
return Ok(false);
}
Expand Down

0 comments on commit e094f8b

Please sign in to comment.