@@ -6662,15 +6662,15 @@ Compressor.prototype.compress = function(node) {
|
||||
do {
|
||||
var head = first.shift();
|
||||
if (tail.index > head.index) continue;
|
||||
var id = head.definition.id;
|
||||
if (!(id in prev)) continue;
|
||||
var head_refs = references[id];
|
||||
var prev_def = head.definition;
|
||||
if (!(prev_def.id in prev)) continue;
|
||||
var head_refs = references[prev_def.id];
|
||||
if (!head_refs) continue;
|
||||
if (head_refs.start.block !== tail_refs.start.block
|
||||
|| !mergeable(head_refs, tail_refs)
|
||||
|| (head_refs.start.loop || !same_scope(def)) && !mergeable(tail_refs, head_refs)
|
||||
|| compressor.option("webkit") && is_funarg(def) !== is_funarg(head.definition)
|
||||
|| head.definition.const_redefs
|
||||
|| compressor.option("webkit") && is_funarg(def) !== is_funarg(prev_def)
|
||||
|| prev_def.const_redefs
|
||||
|| !all(head_refs.scopes, function(scope) {
|
||||
return scope.find_variable(def.name) === def;
|
||||
})) {
|
||||
@@ -6682,12 +6682,14 @@ Compressor.prototype.compress = function(node) {
|
||||
sym.name = def.name;
|
||||
if (sym instanceof AST_SymbolRef) {
|
||||
def.references.push(sym);
|
||||
prev_def.replaced++;
|
||||
} else {
|
||||
def.orig.push(sym);
|
||||
prev_def.eliminated++;
|
||||
}
|
||||
});
|
||||
if (!head.definition.fixed) def.fixed = false;
|
||||
merged[id] = def;
|
||||
if (!prev_def.fixed) def.fixed = false;
|
||||
merged[prev_def.id] = def;
|
||||
changed = true;
|
||||
break;
|
||||
} while (first.length);
|
||||
|
||||
Reference in New Issue
Block a user