diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-05-07 20:58:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 03:58:29 +0800 |
commit | bbca9de9cd7e715bf62a8c624cd3f53e4386b566 (patch) | |
tree | 2e01220b7f5f71a522fc48ce1d9dff851daa2772 /test/compress | |
parent | ee9ceb79ca61c8adb9bbf7e82459ab0bbe3aaced (diff) | |
download | tracifyjs-bbca9de9cd7e715bf62a8c624cd3f53e4386b566.tar.gz tracifyjs-bbca9de9cd7e715bf62a8c624cd3f53e4386b566.zip |
fix corner case in `collapse_vars` (#4919)
fixes #4918
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 85006703..e0c139bd 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -9171,3 +9171,26 @@ issue_4914: { } expect_stdout: "function" } + +issue_4918: { + options = { + collapse_vars: true, + } + input: { + var a = "FAIL"; + ({ + get 42() { + console.log(a); + } + }[a = "PASS", 42] += "PASS"); + } + expect: { + var a = "FAIL"; + ({ + get 42() { + console.log(a); + } + }[a = "PASS", 42] += "PASS"); + } + expect_stdout: "PASS" +} |