From dcbf2236c7df7ea4179dddf3e798229181868599 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 2 Nov 2019 03:34:20 +0800 Subject: [PATCH] more tests for #3562 (#3565) --- test/compress/functions.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/compress/functions.js b/test/compress/functions.js index 0607e85c..1208b62d 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -3370,3 +3370,33 @@ issue_3512: { } expect_stdout: "PASS" } + +issue_3562: { + options = { + collapse_vars: true, + reduce_vars: true, + } + input: { + var a = "PASS"; + function f(b) { + f = function() { + console.log(b); + }; + return "FAIL"; + } + a = f(a); + f(a); + } + expect: { + var a = "PASS"; + function f(b) { + f = function() { + console.log(b); + }; + return "FAIL"; + } + a = f(a); + f(a); + } + expect_stdout: "PASS" +} -- 2.34.1