diff --git a/crates/swc_ecma_minifier/src/compress/pure/bools.rs b/crates/swc_ecma_minifier/src/compress/pure/bools.rs index cf555287e84..814b2d6080e 100644 --- a/crates/swc_ecma_minifier/src/compress/pure/bools.rs +++ b/crates/swc_ecma_minifier/src/compress/pure/bools.rs @@ -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 + } _ => {} } } diff --git a/crates/swc_ecma_minifier/tests/TODO.txt b/crates/swc_ecma_minifier/tests/TODO.txt index 7a1ab7f51cd..ef6a91425cd 100644 --- a/crates/swc_ecma_minifier/tests/TODO.txt +++ b/crates/swc_ecma_minifier/tests/TODO.txt @@ -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 diff --git a/crates/swc_ecma_minifier/tests/golden.txt b/crates/swc_ecma_minifier/tests/golden.txt index d2b768363ce..aece78e07bf 100644 --- a/crates/swc_ecma_minifier/tests/golden.txt +++ b/crates/swc_ecma_minifier/tests/golden.txt @@ -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 diff --git a/crates/swc_ecma_minifier/tests/terser_exec.rs b/crates/swc_ecma_minifier/tests/terser_exec.rs index e4ce45d078b..663e1c299af 100644 --- a/crates/swc_ecma_minifier/tests/terser_exec.rs +++ b/crates/swc_ecma_minifier/tests/terser_exec.rs @@ -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/", ) )]