From 6961c57d1e2849b4c7c9e43295015d0bee44daa5 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 5 Jul 2021 04:57:58 +0100 Subject: fix corner case in `reduce_vars` (#5051) fixes #5050 --- test/compress/reduce_vars.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 735688ea..4af4945f 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -7696,3 +7696,32 @@ issue_5048: { } expect_stdout: "undefined" } + +issue_5050: { + options = { + evaluate: true, + reduce_vars: true, + toplevel: true, + } + input: { + function f() { + console.log(a); + } + this; + var a = 1; + f(console.log(2), f(), a = 3); + } + expect: { + function f() { + console.log(a); + } + this; + var a = 1; + f(console.log(2), f(), a = 3); + } + expect_stdout: [ + "2", + "1", + "3", + ] +} -- cgit v1.2.3