diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-01-28 22:44:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-28 22:44:18 +0800 |
commit | 87119e44a08118bf302a4da6ae71e74f8bea4f89 (patch) | |
tree | 9907c467959cf510bcae59126996485e3c212cbd /test/compress/numbers.js | |
parent | b499e03f82987d59814c81fb9f211fee5e3a7ba4 (diff) | |
download | tracifyjs-87119e44a08118bf302a4da6ae71e74f8bea4f89.tar.gz tracifyjs-87119e44a08118bf302a4da6ae71e74f8bea4f89.zip |
fix corner case in sign propagation (#3696)
- migrate de-facto functionality to `evaluate`
fixes #3695
Diffstat (limited to 'test/compress/numbers.js')
-rw-r--r-- | test/compress/numbers.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/compress/numbers.js b/test/compress/numbers.js index e6f6ce23..9fca46f3 100644 --- a/test/compress/numbers.js +++ b/test/compress/numbers.js @@ -669,6 +669,9 @@ issue_1710: { } unary_binary_parenthesis: { + options = { + evaluate: true, + } input: { var v = [ 0, 1, NaN, Infinity, null, undefined, true, false, "", "foo", /foo/ ]; v.forEach(function(x) { @@ -1233,3 +1236,18 @@ issue_3684: { "Infinity", ] } + +issue_3695: { + options = { + evaluate: true, + } + input: { + var a = []; + console.log(+(a * (a[0] = false))); + } + expect: { + var a = []; + console.log(+(a * (a[0] = false))); + } + expect_stdout: "NaN" +} |