Skip to content

Commit

Permalink
Undo useless changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf0 committed Dec 13, 2022
1 parent ee17b55 commit 5877ca8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions crates/swc_ecma_transforms_base/src/fixer.rs
Expand Up @@ -16,7 +16,6 @@ pub fn fixer(comments: Option<&dyn Comments>) -> impl '_ + Fold + VisitMut {
ctx: Default::default(),
span_map: Default::default(),
in_for_stmt_head: Default::default(),
in_assign_lhs: Default::default(),
remove_only: false,
})
}
Expand All @@ -27,7 +26,6 @@ pub fn paren_remover(comments: Option<&dyn Comments>) -> impl '_ + Fold + VisitM
ctx: Default::default(),
span_map: Default::default(),
in_for_stmt_head: Default::default(),
in_assign_lhs: Default::default(),
remove_only: true,
})
}
Expand All @@ -42,7 +40,6 @@ struct Fixer<'a> {
span_map: FxHashMap<Span, Span>,

in_for_stmt_head: bool,
in_assign_lhs: bool,

remove_only: bool,
}
Expand Down Expand Up @@ -155,18 +152,13 @@ impl VisitMut for Fixer<'_> {
}

fn visit_mut_assign_expr(&mut self, expr: &mut AssignExpr) {
let old = self.in_assign_lhs;

self.in_assign_lhs = true;
expr.left.visit_mut_with(self);

let ctx = self.ctx;
self.ctx = Context::FreeExpr;
self.in_assign_lhs = false;
expr.right.visit_mut_with(self);

self.ctx = ctx;
self.in_assign_lhs = old;

fn rhs_need_paren(e: &Expr) -> bool {
match e {
Expand Down

0 comments on commit 5877ca8

Please sign in to comment.