From f38e31bd1ee117fc8adb0d13982b5ec16e761f52 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 28 Oct 2019 19:56:42 +0800 Subject: fix corner case in `evaluate` (#3540) fixes #3539 --- test/compress/numbers.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/compress/numbers.js b/test/compress/numbers.js index 63a100b7..79fccfb4 100644 --- a/test/compress/numbers.js +++ b/test/compress/numbers.js @@ -765,3 +765,19 @@ issue_3536: { } expect_stdout: "number 99 11 121" } + +issue_3539: { + options = { + evaluate: true, + unsafe_math: true, + } + input: { + var a = -0 + -""; + console.log(0/a, 1/a, -1/a); + } + expect: { + var a = -0; + console.log(0/a, 1/a, -1/a); + } + expect_stdout: "NaN -Infinity Infinity" +} -- cgit v1.2.3