aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/compress.js b/lib/compress.js
index c9ba218d..9d390d09 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -6821,18 +6821,14 @@ merge(Compressor.prototype, {
if (vars_found > 0) {
// collect only vars which don't show up in self's arguments list
var defs = [];
+ if (self instanceof AST_Lambda) self.each_argname(function(argname) {
+ vars.del(argname.name);
+ });
vars.each(function(def, name) {
- if (self instanceof AST_Lambda
- && !all(self.argnames, function(argname) {
- return argname.name != name;
- })) {
- vars.del(name);
- } else {
- def = def.clone();
- def.value = null;
- defs.push(def);
- vars.set(name, def);
- }
+ def = def.clone();
+ def.value = null;
+ defs.push(def);
+ vars.set(name, def);
});
if (defs.length > 0) {
// try to merge in assignments
@@ -6856,7 +6852,7 @@ merge(Compressor.prototype, {
&& vars.has(sym.name)) {
var def = vars.get(sym.name);
if (def.value) break;
- def.value = expr.right;
+ def.value = expr.right.clone();
remove(defs, def);
defs.push(def);
body.shift();