diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index d99310ed..7c1c3b42 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -595,7 +595,14 @@ merge(Compressor.prototype, { var expr = node.expression; if (!(expr instanceof AST_SymbolRef)) return; var def = expr.definition(); - if (is_arguments(def) && node.property instanceof AST_Number) def.reassigned = true; + if (!is_arguments(def)) return; + var key = node.property; + if (key.is_constant()) key = key.value; + if (!(key instanceof AST_Node) && !/^[1-9]*[0-9]$/.test(key)) return; + def.reassigned = true; + (key instanceof AST_Node ? def.scope.argnames : [ def.scope.argnames[key] ]).forEach(function(argname) { + if (argname instanceof AST_SymbolFunarg) argname.definition().fixed = false; + }); } function scan_declaration(tw, lhs, fixed, visit) { |