diff --git a/lib/scope.js b/lib/scope.js index ad31f306..90301d9a 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -469,6 +469,7 @@ AST_Lambda.DEFMETHOD("init_vars", function(parent_scope) { this.uses_arguments = false; this.def_variable(new AST_SymbolFunarg({ name: "arguments", + scope: this, start: this.start, end: this.end, })); diff --git a/test/compress/arrows.js b/test/compress/arrows.js index 389b877a..9691648e 100644 --- a/test/compress/arrows.js +++ b/test/compress/arrows.js @@ -1072,3 +1072,37 @@ issue_5414_2: { expect_stdout: true node_version: ">=4" } + +issue_5416: { + options = { + dead_code: true, + evaluate: true, + inline: true, + loops: true, + unused: true, + } + input: { + var f = () => { + while ((() => { + console; + var a = function g(arguments) { + console.log(arguments); + }(); + })()); + }; + f(); + } + expect: { + var f = () => { + { + arguments = void 0; + console; + console.log(arguments); + var arguments; + } + }; + f(); + } + expect_stdout: "undefined" + node_version: ">=4" +}