From ae9f56be109ccc27003868e997143823957f874d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 15 Jun 2020 01:28:44 +0800 Subject: fix corner case in `evaluate` (#3998) fixes #3997 --- test/compress/evaluate.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/compress/evaluate.js') diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 4fecd701..dd94f613 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -2812,3 +2812,24 @@ operator_in: { "true", ] } + +issue_3997: { + options = { + evaluate: true, + reduce_vars: true, + toplevel: true, + } + input: { + var a = function f(b) { + return b[b += this] = b; + }(0); + console.log(typeof a); + } + expect: { + var a = function f(b) { + return b[b += this] = b; + }(0); + console.log(typeof a); + } + expect_stdout: "string" +} -- cgit v1.2.3