diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-10-24 15:44:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-24 22:44:20 +0800 |
commit | e478da24c7b185322c8898444470036fdec31c0d (patch) | |
tree | 8e5363b1a4374c1a25416d3ad9c77c13e8f78c50 /test/compress | |
parent | c5df8355ba00fdf5ffa81192e0d88cf0dca90061 (diff) | |
download | tracifyjs-e478da24c7b185322c8898444470036fdec31c0d.tar.gz tracifyjs-e478da24c7b185322c8898444470036fdec31c0d.zip |
fix corner case in `collapse_vars` (#4243)
fixes #4242
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 4c3a6eda..dea01b60 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -8556,3 +8556,24 @@ issue_4070: { } expect_stdout: "NaN" } + +issue_4242: { + options = { + collapse_vars: true, + conditionals: true, + reduce_vars: true, + unused: true, + } + input: { + console.log(function() { + if (console) + var a = function(){}, b = (!1 === console || a)(); + }()); + } + expect: { + console.log(function() { + console && (!1 === console || function(){})(); + }()); + } + expect_stdout: "undefined" +} |