diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-06 10:30:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 18:30:50 +0800 |
commit | 3c384cf9a8ed4230cf87f14ab017b613b38df628 (patch) | |
tree | 7a03a1426fff2237af9a24861e2872df390eebad /test/compress | |
parent | 37f4f56752e0672ff8b76b1618266eae628088f7 (diff) | |
download | tracifyjs-3c384cf9a8ed4230cf87f14ab017b613b38df628.tar.gz tracifyjs-3c384cf9a8ed4230cf87f14ab017b613b38df628.zip |
fix corner case in `collapse_vars` (#4332)
fixes #4331
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/spread.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/spread.js b/test/compress/spread.js index 01818dc3..21ccbe6d 100644 --- a/test/compress/spread.js +++ b/test/compress/spread.js @@ -399,3 +399,29 @@ issue_4329: { expect_stdout: "PASS" node_version: ">=8" } + +issue_4331: { + options = { + collapse_vars: true, + toplevel: true, + } + input: { + var a = "PASS", b; + console, + b = a; + (function() { + a++; + })(...a); + console.log(b); + } + expect: { + var a = "PASS", b; + console; + (function() { + a++; + })(...b = a); + console.log(b); + } + expect_stdout: "PASS" + node_version: ">=8" +} |