diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-14 16:22:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 00:22:34 +0800 |
commit | 65d39a3702643a8dc6a3b797a15470e6715d6f84 (patch) | |
tree | 7287a22133ed77e1ffcea7ee8a1560e4fc554b5e /test/compress | |
parent | 24917e7084a9ce240660f8d4b69dcbf1515af084 (diff) | |
download | tracifyjs-65d39a3702643a8dc6a3b797a15470e6715d6f84.tar.gz tracifyjs-65d39a3702643a8dc6a3b797a15470e6715d6f84.zip |
fix corner cases in `collapse_vars` (#4555)
fixes #4554
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/destructured.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 029b4427..7cc6f46d 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -2456,3 +2456,34 @@ issue_4519_2: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4554: { + options = { + collapse_vars: true, + unused: true, + } + input: { + A = "PASS"; + var a = "FAIL"; + try { + (function({}, b) { + return b; + })(void 0, a = A); + } catch (e) { + console.log(a); + } + } + expect: { + A = "PASS"; + var a = "FAIL"; + try { + (function({}, b) { + return b; + })(void 0, a = A); + } catch (e) { + console.log(a); + } + } + expect_stdout: "PASS" + node_version: ">=6" +} |