diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-10-13 08:52:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 15:52:03 +0800 |
commit | 0e234a25c52bcfc873fc1ac287995be08a6756aa (patch) | |
tree | b4ef544ffce2da43bff90c073a9bd220f2d174f2 /test | |
parent | 3096f6fdad2d92b822ab75bbe78903c152e6b844 (diff) | |
download | tracifyjs-0e234a25c52bcfc873fc1ac287995be08a6756aa.tar.gz tracifyjs-0e234a25c52bcfc873fc1ac287995be08a6756aa.zip |
fix corner case in `reduce_vars` (#4211)
fixes #4210
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/const.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/const.js b/test/compress/const.js index aedfdbc3..b161e876 100644 --- a/test/compress/const.js +++ b/test/compress/const.js @@ -930,3 +930,36 @@ issue_4207: { } expect_stdout: "0" } + +issue_4210: { + options = { + reduce_vars: true, + } + input: { + (function() { + try { + throw 42; + } catch (e) { + const a = typeof e; + console.log(a); + } finally { + return a = "foo"; + } + })(); + console.log(typeof a); + } + expect: { + (function() { + try { + throw 42; + } catch (e) { + const a = typeof e; + console.log(a); + } finally { + return a = "foo"; + } + })(); + console.log(typeof a); + } + expect_stdout: true +} |