diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-04-18 15:32:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 22:32:22 +0800 |
commit | fd6144d95baebb9eaa75b5695bd75a492479c691 (patch) | |
tree | 061c6e21d2be74f1e431218bdeae1daf4829c082 /test/compress | |
parent | 60d4e7b09fb962598a9f9f0fb64f92416a9f7e9c (diff) | |
download | tracifyjs-fd6144d95baebb9eaa75b5695bd75a492479c691.tar.gz tracifyjs-fd6144d95baebb9eaa75b5695bd75a492479c691.zip |
enhance `conditionals` (#3798)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/conditionals.js | 2 | ||||
-rw-r--r-- | test/compress/drop-unused.js | 1 | ||||
-rw-r--r-- | test/compress/issue-1639.js | 6 |
3 files changed, 6 insertions, 3 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index c4ae9095..b78f7267 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -1384,7 +1384,7 @@ hoist_decl: { } expect: { var a, b; - x() ? y() : z(); + (x() ? y : z)(); } } diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index 0f4c6dc6..38f132bf 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -1173,6 +1173,7 @@ var_catch_toplevel: { x(); } catch (a) { var a; + var a; } }(); } diff --git a/test/compress/issue-1639.js b/test/compress/issue-1639.js index 1579e06e..6633eb2d 100644 --- a/test/compress/issue-1639.js +++ b/test/compress/issue-1639.js @@ -22,8 +22,10 @@ issue_1639_1: { console.log(a, b); } expect: { - for (var a = 100, b = 10, L1 = 5; --L1 > 0;) - if (--b, 0) var ignore = 0; + for (var a = 100, b = 10, L1 = 5; --L1 > 0;) { + var ignore; + --b; + } console.log(a, b); } expect_stdout: "100 6" |