From 44e494f16f5ce7fc1272e6ca6ae227f77623c2f9 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 18 Dec 2020 16:52:37 +0000 Subject: fix corner case in `merge_vars` (#4407) fixes #4406 --- test/compress/async.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test') diff --git a/test/compress/async.js b/test/compress/async.js index 79189c7d..4fd16efd 100644 --- a/test/compress/async.js +++ b/test/compress/async.js @@ -567,3 +567,33 @@ issue_4377: { expect_stdout: "function" node_version: ">=8" } + +issue_4406: { + options = { + merge_vars: true, + } + input: { + A = "PASS"; + B = "FAIL"; + (function() { + var a, b; + a = A; + (async function({ + [console.log(a)]: {}, + }) {})((b = B) && { undefined: b }); + })(); + } + expect: { + A = "PASS"; + B = "FAIL"; + (function() { + var a, b; + a = A; + (async function({ + [console.log(a)]: {}, + }) {})((b = B) && { undefined: b }); + })(); + } + expect_stdout: "PASS" + node_version: ">=8" +} -- cgit v1.2.3