From 0e29ad5eb9d6267c32f8ffb327aa79478c15e69c Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 4 Nov 2019 13:13:48 +0800 Subject: fix corner case in `evaluate` (#3569) --- test/compress/evaluate.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test') diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 98d0b8d6..74cb65ff 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -1876,3 +1876,27 @@ issue_3558: { } expect_stdout: "1 0" } + +issue_3568: { + options = { + evaluate: true, + reduce_vars: true, + toplevel: true, + unsafe: true, + } + input: { + var a = 0; + function f(b) { + return b && b.p; + } + console.log(f(++a + f())); + } + expect: { + var a = 0; + function f(b) { + return b && b.p; + } + console.log(NaN); + } + expect_stdout: "NaN" +} -- cgit v1.2.3