diff options
-rw-r--r-- | lib/compress.js | 6 | ||||
-rw-r--r-- | test/compress/awaits.js | 18 |
2 files changed, 21 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js index f8cf75f1..5526972f 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -10463,9 +10463,9 @@ merge(Compressor.prototype, { argname = null; } else if (argname) { var arg_def; - if (!(argname instanceof AST_SymbolFunarg)) { - argname = null; - } else if (expr.scope.find_variable(argname.name) !== (arg_def = argname.definition())) { + if (!(argname instanceof AST_SymbolFunarg) + || argname.name == "await" + || expr.scope.find_variable(argname.name) !== (arg_def = argname.definition())) { argname = null; } else if (compressor.has_directive("use strict") || fn.name diff --git a/test/compress/awaits.js b/test/compress/awaits.js index 8caa60c0..89d11bb9 100644 --- a/test/compress/awaits.js +++ b/test/compress/awaits.js @@ -977,3 +977,21 @@ issue_4454_2: { ] node_version: ">=8" } + +issue_4534: { + options = { + arguments: true, + } + input: { + (function(await) { + (async () => console.log(arguments[0]))(); + })("PASS"); + } + expect: { + (function(await) { + (async () => console.log(arguments[0]))(); + })("PASS"); + } + expect_stdout: "PASS" + node_version: ">=8" +} |