Merge pull request #769 from 6to5/if-truthy-minification-returns-consequent

Return the consequent if the test is truthy.
This commit is contained in:
Sebastian McKenzie 2015-02-13 14:08:32 +11:00
commit ba5c5760b1

View File

@ -33,7 +33,7 @@ exports.IfStatement = {
// //
if (t.isLiteral(test) && test.value) { if (t.isLiteral(test) && test.value) {
return alternate; return consequent;
} }
// we can check if a test will be falsy 100% and if so we can inline the // we can check if a test will be falsy 100% and if so we can inline the