@@ -5133,6 +5133,13 @@ merge(Compressor.prototype, {
|
||||
return rhs.right;
|
||||
}
|
||||
|
||||
function cross_scope(def, sym) {
|
||||
do {
|
||||
if (def === sym) return false;
|
||||
if (sym instanceof AST_Scope) return true;
|
||||
} while (sym = sym.parent_scope);
|
||||
}
|
||||
|
||||
function scan_ref_scoped(node, descend, init) {
|
||||
if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef) {
|
||||
var def = node.left.definition();
|
||||
@@ -5186,7 +5193,7 @@ merge(Compressor.prototype, {
|
||||
in_use_ids[node_def.id] = true;
|
||||
in_use.push(node_def);
|
||||
}
|
||||
if (node.scope !== node_def.scope) {
|
||||
if (cross_scope(node_def.scope, node.scope)) {
|
||||
var redef = node_def.redefined();
|
||||
if (redef && !(redef.id in in_use_ids)) {
|
||||
in_use_ids[redef.id] = true;
|
||||
|
||||
Reference in New Issue
Block a user