diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index 7c1c3b42..d532300c 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1743,7 +1743,11 @@ merge(Compressor.prototype, { if (node instanceof AST_LoopControl) return true; if (node instanceof AST_SymbolRef) { if (node.is_declared(compressor)) { - if (node.fixed_value() || can_drop_symbol(node)) return false; + if (node.fixed_value()) return false; + if (can_drop_symbol(node)) { + return !(parent instanceof AST_PropAccess && parent.expression === node) + && is_arguments(node.definition()); + } } else if (parent instanceof AST_Assign && parent.operator == "=" && parent.left === node) { return false; } @@ -1812,7 +1816,9 @@ merge(Compressor.prototype, { return compressor.option("ie8") && node.name && lvalues.has(node.name.name); } if (node instanceof AST_PropAccess) { - return side_effects || !value_def && node.expression.may_throw_on_access(compressor); + var exp = node.expression; + return side_effects || !value_def && exp.may_throw_on_access(compressor) + || exp instanceof AST_SymbolRef && is_arguments(exp.definition()); } if (node instanceof AST_Spread) return true; if (node instanceof AST_SymbolRef) { |