enhance `collapse_vars` (#1862)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sat, 6 May 2017 08:15:43 +0000 (16:15 +0800)
committerGitHub <noreply@github.com>
Sat, 6 May 2017 08:15:43 +0000 (16:15 +0800)
commitdee5a27516cb574dda5fc3d23a64344f0ea654b6
tree3a5d014836971d6f4d6dad26a83d8f8c6e728cfd
parent5a25d24b56067e99ea9e5edc890a66eecbacdd7c
enhance `collapse_vars` (#1862)

- extend expression types
  - `a++`
  - `a=x;`
- extend scan range
  - `for(init;;);`
  - `switch(expr){case expr:}`
  - `a = x; a = a || y;`
- terminate upon `debugger;`

closes #1821
fixes #27
fixes #315
fixes #1858
lib/compress.js
test/compress/collapse_vars.js
test/compress/drop-unused.js
test/compress/issue-1609.js