more fiddling with boolean expressions, etc.
authorMihai Bazon <mihai@bazon.net>
Tue, 4 Sep 2012 10:20:28 +0000 (13:20 +0300)
committerMihai Bazon <mihai@bazon.net>
Tue, 4 Sep 2012 10:20:28 +0000 (13:20 +0300)
commit376667a8188083e4e64ef56bf10f38e4f831447f
tree6a17a3d7ff8276a9795ca696632435d55b08d808
parent3459c40cf9d17c6c791a86d387bba85e965c37b6
more fiddling with boolean expressions, etc.

optimize away while(false), and transform while(true) ==> for(;;).

UNSAFE:

some expressions are optimized away when we're in boolean context and can
determine that the value will always be true or false.  For example:

    x() || true ==> always `true` in boolean context
    x() && false ==> always `false` in boolean context

It's not technically correct to drop these expressions since we drop the
function call too (that might have side effects); on the other hand, I can't
see any legitimate use for such expressions and they might simply indicate a
bug (we do warn about it).
lib/compress.js