diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-10-22 20:36:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-22 20:36:05 +0800 |
commit | 02308a7b5651ce04703fafc43887636642c5e888 (patch) | |
tree | 45c6a5ac0493bbaeb4a29897fae568e010a35c4e /test | |
parent | 0b3705e82f550b82bebb0c4f877ce8f41fc7495d (diff) | |
download | tracifyjs-02308a7b5651ce04703fafc43887636642c5e888.tar.gz tracifyjs-02308a7b5651ce04703fafc43887636642c5e888.zip |
fix corner case in `reduce_vars` (#3510)
fixes #3509
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/reduce_vars.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 744cdf1b..ce7c16da 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -6752,3 +6752,31 @@ issue_3377: { } expect_stdout: "42" } + +issue_3509: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function a() { + console.log("PASS"); + } + try { + } catch (a) { + var a; + } + a(); + } + expect: { + try { + } catch (a) { + var a; + } + (function() { + console.log("PASS"); + })(); + } + expect_stdout: "PASS" +} |