We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
else if
if
1 parent dc4c388 commit 831928dCopy full SHA for 831928d
crates/oxc_minifier/src/peephole/minimize_statements.rs
@@ -262,6 +262,7 @@ impl<'a> PeepholeOptimizations {
262
if if_stmt.consequent.is_jump_statement() {
263
if let Some(stmt) = if_stmt.alternate.take() {
264
result.push(stmt);
265
+ self.mark_current_function_as_changed();
266
continue;
267
}
268
crates/oxc_minifier/tests/peephole/mod.rs
@@ -76,6 +76,19 @@ fn integration() {
76
console.log(c, d);
77
",
78
);
79
+
80
+ test(
81
+ "function _() {
82
+ if (currentChar === '\\n')
83
+ return pos + 1;
84
+ else if (currentChar !== ' ' && currentChar !== '\\t')
85
86
+ }",
87
88
+ if (currentChar === '\\n' || currentChar !== ' ' && currentChar !== '\\t')
89
90
91
+ );
92
93
94
#[test]
0 commit comments