From 499f8d89ffd03f6f7d5b7235f4345516176e044b Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 7 Dec 2020 03:30:37 +0000 Subject: fix corner case in `inline` (#4336) fixes #4335 --- test/compress/async.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'test/compress/async.js') diff --git a/test/compress/async.js b/test/compress/async.js index 2e4698d2..8da545bd 100644 --- a/test/compress/async.js +++ b/test/compress/async.js @@ -216,3 +216,51 @@ collapse_vars_3: { expect_stdout: "PASS" node_version: ">=8" } + +issue_4335_1: { + options = { + inline: true, + } + input: { + var await = "PASS"; + (async function() { + console.log(function() { + return await; + }()); + })(); + } + expect: { + var await = "PASS"; + (async function() { + console.log(function() { + return await; + }()); + })(); + } + expect_stdout: "PASS" + node_version: ">=8" +} + +issue_4335_2: { + options = { + inline: true, + } + input: { + (async function() { + console.log(function() { + function await() {} + return "PASS"; + }()); + })(); + } + expect: { + (async function() { + console.log(function() { + function await() {} + return "PASS"; + }()); + })(); + } + expect_stdout: "PASS" + node_version: ">=8" +} -- cgit v1.2.3