handle AST_Arrow IIFEs in collapse_vars
This commit is contained in:
@@ -850,8 +850,8 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
|
||||
function has_overlapping_symbol(fn, arg) {
|
||||
var found = false;
|
||||
var tw = new TreeWalker(function(node) {
|
||||
var found = false, scan_this = !(fn instanceof AST_Arrow);
|
||||
arg.walk(new TreeWalker(function(node, descend) {
|
||||
if (found) return true;
|
||||
if (node instanceof AST_SymbolRef && fn.variables.has(node.name)) {
|
||||
var s = node.definition().scope;
|
||||
@@ -860,11 +860,17 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
return found = true;
|
||||
}
|
||||
if (node instanceof AST_This && !tw.find_parent(AST_Scope)) {
|
||||
if (scan_this && node instanceof AST_This) {
|
||||
return found = true;
|
||||
}
|
||||
});
|
||||
arg.walk(tw);
|
||||
if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) {
|
||||
var prev = scan_this;
|
||||
scan_this = false;
|
||||
descend();
|
||||
scan_this = prev;
|
||||
return true;
|
||||
}
|
||||
}));
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user