diff options
Diffstat (limited to 'test/compress/numbers.js')
-rw-r--r-- | test/compress/numbers.js | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/test/compress/numbers.js b/test/compress/numbers.js index c40ca09d..fdfb6c2f 100644 --- a/test/compress/numbers.js +++ b/test/compress/numbers.js @@ -1075,11 +1075,11 @@ issue_3653: { } expect: { console.log(0 - (console && 0)); - console.log(0 - (console && 0) + 0); + console.log(0 - (console && 0)); console.log(0 - (0 - (console && 0))); console.log(0 - (console && 0)); console.log(1 / (0 - (console && 0))); - console.log(0 - (console && 0) + 0); + console.log(0 - (console && 0)); console.log(0 - (console && 0)); console.log(0 - (console && 0)); console.log(0 - (console && 0)); @@ -1167,3 +1167,51 @@ issue_3676_2: { } expect_stdout: "NaN" } + +issue_3682_1: { + options = { + evaluate: true, + unsafe_math: true, + } + input: { + var a = -0; + console.log(1 / (a - 1 + 1)); + } + expect: { + var a = -0; + console.log(1 / (a - 1 + 1)); + } + expect_stdout: "Infinity" +} + +issue_3682_2: { + options = { + evaluate: true, + unsafe_math: true, + } + input: { + var a = -0, b = 1; + console.log(1 / (a - (b - b))); + } + expect: { + var a = -0, b = 1; + console.log(1 / (a - (b - b))); + } + expect_stdout: "-Infinity" +} + +issue_3682_3: { + options = { + evaluate: true, + unsafe_math: true, + } + input: { + var a = -0, b = 1, c = -1; + console.log(1 / (a - (+b + +c))); + } + expect: { + var a = -0, b = 1, c = -1; + console.log(1 / (a - (+b + +c))); + } + expect_stdout: "-Infinity" +} |