fix `has_side_effects()` (#1675)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sat, 25 Mar 2017 15:03:26 +0000 (23:03 +0800)
committerGitHub <noreply@github.com>
Sat, 25 Mar 2017 15:03:26 +0000 (23:03 +0800)
commitb19aa58cff73ea59438346db094de4a54463d669
treeebdeceeb65f8cc761e9f6f323713108ca691bbc9
parent0a65de89b97731cd83a077303dd0511ba7ff7151
fix `has_side_effects()` (#1675)

`AST_Try` is an `AST_Block`, so besides try block we also need to inspect catch and finally blocks for possible side effects.

Also extend this functionality to handle `AST_If` and `AST_LabeledStatement` while we are at it.

fixes #1673
lib/compress.js
test/compress/issue-1673.js [new file with mode: 0644]