diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-09-04 13:20:28 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-09-04 13:20:28 +0300 |
commit | 376667a8188083e4e64ef56bf10f38e4f831447f (patch) | |
tree | 6a17a3d7ff8276a9795ca696632435d55b08d808 /tmp/test-node.js | |
parent | 3459c40cf9d17c6c791a86d387bba85e965c37b6 (diff) | |
download | tracifyjs-376667a8188083e4e64ef56bf10f38e4f831447f.tar.gz tracifyjs-376667a8188083e4e64ef56bf10f38e4f831447f.zip |
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).
Diffstat (limited to 'tmp/test-node.js')
0 files changed, 0 insertions, 0 deletions