optimization for if/break as first statement in a loop body
authorMihai Bazon <mihai@bazon.net>
Wed, 7 Nov 2012 16:57:51 +0000 (18:57 +0200)
committerMihai Bazon <mihai@bazon.net>
Thu, 8 Nov 2012 09:43:14 +0000 (11:43 +0200)
commit1a5fd3e05294a74900c6265f364f233e3f05eba0
tree44dedf148901474390eb3b34e2a38364575b72a3
parent5a7e54cf724d28eab424acd92f097207ee69afbd
optimization for if/break as first statement in a loop body

    for(...; x; ...) if (y) break; → for(...; x&&!y; ...);

similarly for `while` and some combinations (i.e. the `break` appears in the
`else` clause, etc.)
lib/compress.js
test/compress/loops.js [new file with mode: 0644]