mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 17:54:15 +03:00
fix(es/minifier): Remove wrong logic for optimizing delete
s (#4429)
This commit is contained in:
parent
2dee47c430
commit
8118569045
@ -259,12 +259,7 @@ impl Pure<'_> {
|
|||||||
|
|
||||||
pub(super) fn handle_negated_seq(&mut self, n: &mut Expr) {
|
pub(super) fn handle_negated_seq(&mut self, n: &mut Expr) {
|
||||||
match &mut *n {
|
match &mut *n {
|
||||||
Expr::Unary(e @ UnaryExpr { op: op!("!"), .. })
|
Expr::Unary(e @ UnaryExpr { op: op!("!"), .. }) => {
|
||||||
| Expr::Unary(
|
|
||||||
e @ UnaryExpr {
|
|
||||||
op: op!("delete"), ..
|
|
||||||
},
|
|
||||||
) => {
|
|
||||||
if let Expr::Seq(SeqExpr { exprs, .. }) = &mut *e.arg {
|
if let Expr::Seq(SeqExpr { exprs, .. }) = &mut *e.arg {
|
||||||
if exprs.is_empty() {
|
if exprs.is_empty() {
|
||||||
return;
|
return;
|
||||||
@ -281,6 +276,11 @@ impl Pure<'_> {
|
|||||||
*n = *e.arg.take();
|
*n = *e.arg.take();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Expr::Unary(UnaryExpr {
|
||||||
|
op: op!("delete"), ..
|
||||||
|
}) => {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,6 +241,8 @@ reduce_vars/obj_var_2/input.js
|
|||||||
reduce_vars/variables_collision_in_immediately_invoked_func/input.js
|
reduce_vars/variables_collision_in_immediately_invoked_func/input.js
|
||||||
regexp/unsafe_slashes/input.js
|
regexp/unsafe_slashes/input.js
|
||||||
return_undefined/return_undefined/input.js
|
return_undefined/return_undefined/input.js
|
||||||
|
sequences/delete_seq_4/input.js
|
||||||
|
sequences/delete_seq_5/input.js
|
||||||
sequences/for_sequences/input.js
|
sequences/for_sequences/input.js
|
||||||
sequences/issue_1758/input.js
|
sequences/issue_1758/input.js
|
||||||
sequences/lift_sequences_5/input.js
|
sequences/lift_sequences_5/input.js
|
||||||
|
@ -1234,8 +1234,6 @@ sequences/call/input.js
|
|||||||
sequences/delete_seq_1/input.js
|
sequences/delete_seq_1/input.js
|
||||||
sequences/delete_seq_2/input.js
|
sequences/delete_seq_2/input.js
|
||||||
sequences/delete_seq_3/input.js
|
sequences/delete_seq_3/input.js
|
||||||
sequences/delete_seq_4/input.js
|
|
||||||
sequences/delete_seq_5/input.js
|
|
||||||
sequences/delete_seq_6/input.js
|
sequences/delete_seq_6/input.js
|
||||||
sequences/forin/input.js
|
sequences/forin/input.js
|
||||||
sequences/func_def_2/input.js
|
sequences/func_def_2/input.js
|
||||||
|
@ -59,8 +59,6 @@ use testing::assert_eq;
|
|||||||
"issue_1750/case_1/",
|
"issue_1750/case_1/",
|
||||||
"properties/issue_3188_3/",
|
"properties/issue_3188_3/",
|
||||||
"rename/function_catch_catch/",
|
"rename/function_catch_catch/",
|
||||||
"sequences/delete_seq_4/",
|
|
||||||
"sequences/delete_seq_5/",
|
|
||||||
"yield/issue_2689/",
|
"yield/issue_2689/",
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
Loading…
Reference in New Issue
Block a user