Skip to content

Commit

Permalink
chore(minifier): add two || test cases to dce_if_statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jul 13, 2024
1 parent 22d56bd commit ab41c52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/oxc_minifier/tests/oxc/remove_dead_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ fn dce_if_statement() {
test("if (!false && xxx) { foo }", "if (xxx) { foo; }");
test("if (!true && yyy) { foo } else { bar }", "{ bar }");

test("if (true || xxx) { foo }", "{ foo }");
test("if (false || xxx) { foo }", "if (xxx) { foo }");

test("if ('production' == 'production') { foo } else { bar }", "{ foo }");
test("if ('development' == 'production') { foo } else { bar }", "{ bar }");

Expand Down

0 comments on commit ab41c52

Please sign in to comment.