diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index 309b87ce..aa7affc4 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3177,16 +3177,19 @@ merge(Compressor.prototype, { if (exp.argnames.length > 0) { fn.body.push(make_node(AST_Var, self, { definitions: exp.argnames.map(function(sym, i) { + var arg = self.args[i]; return make_node(AST_VarDef, sym, { name: sym, - value: self.args[i] || make_node(AST_Undefined, self) + value: arg ? arg.clone(true) : make_node(AST_Undefined, self) }); }) })); } if (self.args.length > exp.argnames.length) { fn.body.push(make_node(AST_SimpleStatement, self, { - body: make_sequence(self, self.args.slice(exp.argnames.length)) + body: make_sequence(self, self.args.slice(exp.argnames.length).map(function(node) { + return node.clone(true); + })) })); } fn.body.push(make_node(AST_Return, self, { |