diff --git a/lib/compress.js b/lib/compress.js index e135acaf..ba7c10f4 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3530,6 +3530,7 @@ merge(Compressor.prototype, { && !exp.uses_arguments && !exp.uses_eval && exp.body.length == 1 + && !exp.contains_this() && all(exp.argnames, function(arg) { return arg.__unused; }) @@ -3543,23 +3544,6 @@ merge(Compressor.prototype, { expression: stat.body }); } - if (value) { - var tw = new TreeWalker(function(node) { - if (!value) return true; - if (node instanceof AST_SymbolRef) { - var ref = node.scope.find_variable(node); - if (ref && ref.scope.parent_scope === fn.parent_scope) { - value = null; - return true; - } - } - if (node instanceof AST_This && !tw.find_parent(AST_Scope)) { - value = null; - return true; - } - }); - value.walk(tw); - } if (value) { var args = self.args.concat(value); return make_sequence(self, args).optimize(compressor);