From aecbabc587247f65316988629d17aa29383f9156 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 18 Nov 2020 21:44:47 +0000 Subject: fix corner case in `merge_vars` (#4302) fixes #4301 --- test/compress/destructured.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test') diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 8671d87b..bbe62a71 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -1559,3 +1559,35 @@ issue_4298: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4301: { + options = { + merge_vars: true, + } + input: { + try { + console.log(function() { + var a, b = console; + return { + [a = b]: a.p, + } = "foo"; + }()); + } catch (e) { + console.log("bar"); + } + } + expect: { + try { + console.log(function() { + var a, b = console; + return { + [a = b]: a.p, + } = "foo"; + }()); + } catch (e) { + console.log("bar"); + } + } + expect_stdout: true + node_version: ">=6" +} -- cgit v1.2.3