refactor(es/compat): Remove usage of box_patterns (#7613)

This commit is contained in:
David Sherret 2023-07-02 21:52:51 -04:00 committed by GitHub
parent cba986807a
commit 0a26066b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -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),

View File

@ -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,