diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-10-28 13:37:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 13:37:08 +0800 |
commit | 2f3b46021239c88e4eb38a8d26ae105aaf78d2d1 (patch) | |
tree | b725db253b0c0a45a91242fb38991da7db85624f /test/compress | |
parent | 06e135e35f688cc2527a92fd30c9a30f119805bd (diff) | |
download | tracifyjs-2f3b46021239c88e4eb38a8d26ae105aaf78d2d1.tar.gz tracifyjs-2f3b46021239c88e4eb38a8d26ae105aaf78d2d1.zip |
fix & enhance `unsafe_math` (#3537)
closes #3535
fixes #3536
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/numbers.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/compress/numbers.js b/test/compress/numbers.js index 7946ba8a..63a100b7 100644 --- a/test/compress/numbers.js +++ b/test/compress/numbers.js @@ -713,7 +713,7 @@ issue_3531_1: { } expect: { var a = "1"; - console.log(typeof (a + 1 - (.2 + .1))); + console.log(typeof (a + 1 - .3)); } expect_stdout: "number" } @@ -747,3 +747,21 @@ issue_3531_3: { } expect_stdout: "-22" } + +issue_3536: { + options = { + evaluate: true, + unsafe_math: true, + } + input: { + var a = 100, b = 10; + var c = --a + ("23" - (b++, 1)); + console.log(typeof c, a, b, c); + } + expect: { + var a = 100, b = 10; + var c = --a + ("23" - (b++, 1)); + console.log(typeof c, a, b, c); + } + expect_stdout: "number 99 11 121" +} |