Rich-Harris / butternut

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

BinaryExpression literal inlining too eagerly #75

Closed jbt closed 7 years ago

jbt commented 7 years ago

BinaryExpressions are getting replaced with a literal when both operands aren't UNKNOWN, which erroneously includes the case if one is either TRUTHY or FALSY

So for example things like these are ending up wrong:

Seems fixable by just checking both operands are definitely also not either TRUTHY or FALSY - PR coming right up