fix corner cases in `reduce_vars` (#1524)
authorAlex Lam S.L <alexlamsl@gmail.com>
Wed, 1 Mar 2017 16:20:53 +0000 (00:20 +0800)
committerGitHub <noreply@github.com>
Wed, 1 Mar 2017 16:20:53 +0000 (00:20 +0800)
commit7aa69117e1a38e4aeead13100ac952ca99dbb07f
tree6b957de603843f936905ff76caceb22a2e625a4c
parentbff7ad67bbab6ce0792292fba66d3a6cf8d1836f
fix corner cases in `reduce_vars` (#1524)

Avoid variable substitution in the following cases:
- use of variable before declaration
- declaration within conditional code blocks
- declaration within loop body

fixes #1518
fixes #1525
lib/compress.js
test/compress/reduce_vars.js