Rich-Harris / butternut

The fast, future-friendly minifier
https://butternut.now.sh
MIT License
1.17k stars 17 forks source link

Handle IfStatement with empty consequent+alternate but non-removable test #90

Closed jbt closed 7 years ago

jbt commented 7 years ago

This handles the case of:

if ( foo() ) {
  // empty
} else {
  // also empty
}

... which currently is being minified as:

if ( foo() ) {
  // empty
} else

Not entirely sure why you'd have both consequent + alternate be empty but apparently I've written a few myself by repeatedly commenting stuff out.

Rich-Harris commented 7 years ago

nice, thank you!