improve switch optimisations (#1677)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sat, 25 Mar 2017 21:15:46 +0000 (05:15 +0800)
committerGitHub <noreply@github.com>
Sat, 25 Mar 2017 21:15:46 +0000 (05:15 +0800)
commitf83d370f57c49e5112ac5ce74e27a0573265baf6
tree4e40bc3039149edc283f32e1e65759f14ab60365
parentb19aa58cff73ea59438346db094de4a54463d669
improve switch optimisations (#1677)

- correctly determine reachability of (default) branches
- gracefully handle multiple default branches
- optimise branches with duplicate bodies

fixes #376
fixes #441
fixes #1674
lib/compress.js
test/compress/switch.js