diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-07-20 16:28:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 23:28:13 +0800 |
commit | a5db8cd14c55aa64cb6e5cfb4f98f87aa38504dd (patch) | |
tree | 3111a63135e2659e51f2a8096e9d6b732f3c53e9 /test/compress | |
parent | 2021c2fa3e616da497f8fc305010c9c1dd1a67de (diff) | |
download | tracifyjs-a5db8cd14c55aa64cb6e5cfb4f98f87aa38504dd.tar.gz tracifyjs-a5db8cd14c55aa64cb6e5cfb4f98f87aa38504dd.zip |
fix corner case in `collapse_vars` (#4013)
fixes #4012
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index dcc95b23..109bbde0 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -8280,3 +8280,40 @@ issue_3976: { } expect_stdout: "PASS" } + +issue_4012: { + options = { + collapse_vars: true, + dead_code: true, + evaluate: true, + } + input: { + (function(a) { + try { + throw 2; + } catch (b) { + a = "PASS"; + if (--b) + return; + if (3); + } finally { + console.log(a); + } + })(); + } + expect: { + (function(a) { + try { + throw 2; + } catch (b) { + a = "PASS"; + if (--b) + return; + if (3); + } finally { + console.log(a); + } + })(); + } + expect_stdout: "PASS" +} |