swc/ecmascript/minifier/tests/terser/compress/conditionals/cond_7/input.js
강동윤 c6b22c57f8
feat(es/minifier): Implement minifier partially (#1302)
Co-authored-by: Fábio Santos <fabiosantosart@gmail.com>
2021-05-20 13:51:30 +09:00

31 lines
449 B
JavaScript

var x, y, z, a, b;
if (y) {
x = 1 + 1;
} else {
x = 2;
}
if (y) {
x = 1 + 1;
} else if (z) {
x = 2;
} else {
x = 3 - 1;
}
x = y ? "foo" : "fo" + "o";
x = y ? "foo" : y ? "foo" : "fo" + "o";
if (condition()) {
x = 10 + 10;
} else {
x = 20;
}
if (z) {
x = "fuji";
} else if (condition()) {
x = "fu" + "ji";
} else {
x = "fuji";
}
x = condition() ? "foobar" : "foo" + "bar";
x = y ? a : b;
x = y ? "foo" : "fo";