diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-01-30 09:04:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 09:04:44 +0800 |
commit | 79c60032a55b518e07acb45237e527b4fe61c8e6 (patch) | |
tree | 75ee56238ebb10f04ebc2c512a903252c11f4977 /test/compress | |
parent | a3754068dde7a51ab41b59a6d8a17a3a8c022564 (diff) | |
download | tracifyjs-79c60032a55b518e07acb45237e527b4fe61c8e6.tar.gz tracifyjs-79c60032a55b518e07acb45237e527b4fe61c8e6.zip |
fix corner case in `collapse_vars` (#3701)
fixes #3700
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index f109e93e..58ae5c62 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -7734,3 +7734,34 @@ issue_3698_3: { } expect_stdout: "2" } + +issue_3700: { + options = { + collapse_vars: true, + } + input: { + var a = "FAIL"; + try { + a = "PASS"; + (function() { + throw 0; + })(); + a = 1 + a; + } catch (e) { + } + console.log(a); + } + expect: { + var a = "FAIL"; + try { + a = "PASS"; + (function() { + throw 0; + })(); + a = 1 + a; + } catch (e) { + } + console.log(a); + } + expect_stdout: "PASS" +} |