mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 02:29:04 +03:00
refactor(es/compat): Remove usage of box_patterns
(#7613)
This commit is contained in:
parent
cba986807a
commit
0a26066b7b
@ -66,14 +66,19 @@ impl VisitMut for OptChaining {
|
||||
*e = self.construct(data, false, self.c.no_document_all);
|
||||
}
|
||||
|
||||
// delete foo?.bar -> foo == null ? true : delete foo.bar
|
||||
Expr::Unary(UnaryExpr {
|
||||
arg: box Expr::OptChain(v),
|
||||
arg,
|
||||
op: op!("delete"),
|
||||
..
|
||||
}) => {
|
||||
let data = self.gather(v.take(), vec![]);
|
||||
*e = self.construct(data, true, self.c.no_document_all);
|
||||
match &mut **arg {
|
||||
// delete foo?.bar -> foo == null ? true : delete foo.bar
|
||||
Expr::OptChain(v) => {
|
||||
let data = self.gather(v.take(), vec![]);
|
||||
*e = self.construct(data, true, self.c.no_document_all);
|
||||
}
|
||||
_ => e.visit_mut_children_with(self),
|
||||
}
|
||||
}
|
||||
|
||||
e => e.visit_mut_children_with(self),
|
||||
|
@ -3,7 +3,6 @@
|
||||
#![allow(clippy::vec_box)]
|
||||
#![allow(clippy::boxed_local)]
|
||||
#![allow(clippy::match_like_matches_macro)]
|
||||
#![feature(box_patterns)]
|
||||
|
||||
pub use self::{
|
||||
bugfixes::bugfixes, es2015::es2015, es2016::es2016, es2017::es2017, es2018::es2018,
|
||||
|
Loading…
Reference in New Issue
Block a user