diff options
-rw-r--r-- | lib/compress.js | 1 | ||||
-rw-r--r-- | test/compress/arrows.js | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js index 29cd26b6..2c1f87d1 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -358,6 +358,7 @@ merge(Compressor.prototype, { function is_arguments(def) { if (def.name != "arguments") return false; + if (!def.scope.uses_arguments) return false; var orig = def.orig; return orig.length == 1 && orig[0] instanceof AST_SymbolFunarg; } diff --git a/test/compress/arrows.js b/test/compress/arrows.js index cc5aec5f..990090b2 100644 --- a/test/compress/arrows.js +++ b/test/compress/arrows.js @@ -587,3 +587,32 @@ issue_4401: { ] node_version: ">=4" } + +issue_4448: { + options = { + pure_getters: "strict", + side_effects: true, + } + input: { + var A; + try { + (arguments => { + arguments[0]; + })(A); + } catch (e) { + console.log("PASS"); + } + } + expect: { + var A; + try { + (arguments => { + arguments[0]; + })(A); + } catch (e) { + console.log("PASS"); + } + } + expect_stdout: "PASS" + node_version: ">=4" +} |