@@ -823,16 +823,23 @@ merge(Compressor.prototype, {
|
||||
fn.argnames.forEach(function(sym, i) {
|
||||
var arg = iife.args[i];
|
||||
if (!arg) arg = make_node(AST_Undefined, sym);
|
||||
else arg.walk(new TreeWalker(function(node) {
|
||||
if (!arg) return true;
|
||||
if (node instanceof AST_SymbolRef && fn.variables.has(node.name)) {
|
||||
var s = node.definition().scope;
|
||||
if (s !== scope) while (s = s.parent_scope) {
|
||||
if (s === scope) return true;
|
||||
else {
|
||||
var tw = new TreeWalker(function(node) {
|
||||
if (!arg) return true;
|
||||
if (node instanceof AST_SymbolRef && fn.variables.has(node.name)) {
|
||||
var s = node.definition().scope;
|
||||
if (s !== scope) while (s = s.parent_scope) {
|
||||
if (s === scope) return true;
|
||||
}
|
||||
arg = null;
|
||||
}
|
||||
arg = null;
|
||||
}
|
||||
}));
|
||||
if (node instanceof AST_This && !tw.find_parent(AST_Scope)) {
|
||||
arg = null;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
arg.walk(tw);
|
||||
}
|
||||
if (arg) candidates.push(make_node(AST_VarDef, sym, {
|
||||
name: sym,
|
||||
value: arg
|
||||
|
||||
Reference in New Issue
Block a user