Skip to content

Commit

Permalink
Remove is_opt_call
Browse files Browse the repository at this point in the history
  • Loading branch information
levi-nz committed Jun 24, 2024
1 parent 7c7836e commit 6bc56e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions crates/swc_ecma_minifier/src/compress/pure/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ pub(super) struct Ctx {
#[allow(unused)]
pub is_callee: bool,

pub is_opt_call: bool,

pub _in_try_block: bool,

pub is_lhs_of_assign: bool,
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_minifier/src/compress/pure/member_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl Pure<'_> {
obj: &mut Expr,
prop: &MemberProp,
) -> Option<Expr> {
if !self.options.pristine_globals || self.ctx.is_lhs_of_assign || self.ctx.is_opt_call {
if !self.options.pristine_globals || self.ctx.is_lhs_of_assign || self.ctx.is_callee {
return None;
}

Expand Down
3 changes: 1 addition & 2 deletions crates/swc_ecma_minifier/src/compress/pure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl VisitMut for Pure<'_> {
fn visit_mut_opt_call(&mut self, opt_call: &mut OptCall) {
{
let ctx = Ctx {
is_opt_call: true,
is_callee: true,
..self.ctx
};
opt_call.callee.visit_mut_with(&mut *self.with_ctx(ctx));
Expand Down Expand Up @@ -882,7 +882,6 @@ impl VisitMut for Pure<'_> {
let ctx = Ctx {
is_update_arg: false,
is_callee: false,
is_opt_call: false,
in_delete: false,
in_first_expr: true,
..self.ctx
Expand Down

0 comments on commit 6bc56e9

Please sign in to comment.