fix corner cases in switch and undefined (#1762)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sun, 2 Apr 2017 06:52:25 +0000 (14:52 +0800)
committerGitHub <noreply@github.com>
Sun, 2 Apr 2017 06:52:25 +0000 (14:52 +0800)
commitf7ca4f229795f87674d32e2df3de3cf1f8367a39
tree3350123bdb3d590b3266009ff7649c5106c58afe
parentc076e7b60d356def1b94e5856034b38fc93312fd
fix corner cases in switch and undefined (#1762)

- fix side effects in switch condition for singular blocks
- fix `undefined` confusion with local variable
- gate `OPT(AST_Switch)` with `switches`

fixes #1758
fixes #1759
lib/compress.js
test/compress/issue-1750.js
test/compress/reduce_vars.js
test/compress/sequences.js
test/compress/switch.js