From f68e267830c94f129df4c9e93674abfafbc0125b Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 16 Dec 2020 20:47:48 +0000 Subject: fix corner case in `reduce_vars` (#4384) fixes #4383 --- test/compress/destructured.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/compress') diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 086790f0..9fd425d1 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -1844,3 +1844,25 @@ issue_4372_2: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4383: { + options = { + evaluate: true, + reduce_vars: true, + unsafe: true, + } + input: { + console.log(function(a) { + [ a[0] ] = []; + return a.length; + }([])); + } + expect: { + console.log(function(a) { + [ a[0] ] = []; + return a.length; + }([])); + } + expect_stdout: "1" + node_version: ">=6" +} -- cgit v1.2.3