From 336336f53f7f1ba161abc7834da190504afeb27b Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 7 Dec 2020 20:29:54 +0000 Subject: fix corner case with parentheses around `await` (#4344) --- test/compress/async.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/compress') diff --git a/test/compress/async.js b/test/compress/async.js index cab1f92a..ca604034 100644 --- a/test/compress/async.js +++ b/test/compress/async.js @@ -306,3 +306,25 @@ issue_4340: { expect_stdout: "PASS" node_version: ">=8" } + +call_expression: { + input: { + console.log(typeof async function(log) { + (await log)("FAIL"); + }(console.log).then); + } + expect_exact: 'console.log(typeof async function(log){(await log)("FAIL")}(console.log).then);' + expect_stdout: "function" + node_version: ">=8" +} + +property_access_expression: { + input: { + console.log(typeof async function(con) { + (await con).log("FAIL"); + }(console).then); + } + expect_exact: 'console.log(typeof async function(con){(await con).log("FAIL")}(console).then);' + expect_stdout: "function" + node_version: ">=8" +} -- cgit v1.2.3