fix(es/minifier): Remove wrong logic for optimizing deletes (#4429)

This commit is contained in:
Donny/강동윤 2022-04-25 21:32:02 +09:00 committed by GitHub
parent 2dee47c430
commit 8118569045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 10 deletions

View File

@ -259,12 +259,7 @@ impl Pure<'_> {
pub(super) fn handle_negated_seq(&mut self, n: &mut Expr) {
match &mut *n {
Expr::Unary(e @ UnaryExpr { op: op!("!"), .. })
| Expr::Unary(
e @ UnaryExpr {
op: op!("delete"), ..
},
) => {
Expr::Unary(e @ UnaryExpr { op: op!("!"), .. }) => {
if let Expr::Seq(SeqExpr { exprs, .. }) = &mut *e.arg {
if exprs.is_empty() {
return;
@ -281,6 +276,11 @@ impl Pure<'_> {
*n = *e.arg.take();
}
}
Expr::Unary(UnaryExpr {
op: op!("delete"), ..
}) => {
// TODO
}
_ => {}
}
}

View File

@ -241,6 +241,8 @@ reduce_vars/obj_var_2/input.js
reduce_vars/variables_collision_in_immediately_invoked_func/input.js
regexp/unsafe_slashes/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/issue_1758/input.js
sequences/lift_sequences_5/input.js

View File

@ -1234,8 +1234,6 @@ sequences/call/input.js
sequences/delete_seq_1/input.js
sequences/delete_seq_2/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/forin/input.js
sequences/func_def_2/input.js

View File

@ -59,8 +59,6 @@ use testing::assert_eq;
"issue_1750/case_1/",
"properties/issue_3188_3/",
"rename/function_catch_catch/",
"sequences/delete_seq_4/",
"sequences/delete_seq_5/",
"yield/issue_2689/",
)
)]