diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-01-07 19:34:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-07 19:34:16 +0800 |
commit | 4d6771b9b1d89f0b49625795a92267d6e59dd064 (patch) | |
tree | a7c310734d1bdc81bc4a3836b133b6e554c29411 /test | |
parent | d17191111a24988195c364ccf7b71251440175ee (diff) | |
download | tracifyjs-4d6771b9b1d89f0b49625795a92267d6e59dd064.tar.gz tracifyjs-4d6771b9b1d89f0b49625795a92267d6e59dd064.zip |
fix corner case in `collapse_vars` (#3672)
fixes #3671
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/collapse_vars.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index a5975279..c3832d43 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -7464,3 +7464,30 @@ issue_3651: { } expect_stdout: "PASS" } + +issue_3671: { + options = { + collapse_vars: true, + } + input: { + var a = 0; + try { + a++; + A += 0; + a = 1 + a; + } catch (e) { + console.log(a); + } + } + expect: { + var a = 0; + try { + a++; + A += 0; + a = 1 + a; + } catch (e) { + console.log(a); + } + } + expect_stdout: "1" +} |