Merge pull request #769 from 6to5/if-truthy-minification-returns-consequent
Return the consequent if the test is truthy.
This commit is contained in:
commit
ba5c5760b1
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user