@@ -479,8 +479,7 @@ merge(Compressor.prototype, {
|
||||
if (def.fixed === false) return false;
|
||||
if (def.fixed != null && (!value || def.references.length > 0)) return false;
|
||||
return !def.orig.some(function(sym) {
|
||||
return sym instanceof AST_SymbolConst
|
||||
|| sym instanceof AST_SymbolDefun
|
||||
return sym instanceof AST_SymbolDefun
|
||||
|| sym instanceof AST_SymbolLambda;
|
||||
});
|
||||
}
|
||||
@@ -497,7 +496,7 @@ merge(Compressor.prototype, {
|
||||
def.escaped = false;
|
||||
if (def.scope.uses_eval) {
|
||||
def.fixed = false;
|
||||
} else if (!def.global || def.orig[0] instanceof AST_SymbolConst || compressor.toplevel(def)) {
|
||||
} else if (!def.global || compressor.toplevel(def)) {
|
||||
def.fixed = undefined;
|
||||
} else {
|
||||
def.fixed = false;
|
||||
@@ -531,14 +530,6 @@ merge(Compressor.prototype, {
|
||||
return lhs instanceof AST_SymbolRef && lhs.definition().orig[0] instanceof AST_SymbolLambda;
|
||||
}
|
||||
|
||||
function is_reference_const(ref) {
|
||||
if (!(ref instanceof AST_SymbolRef)) return false;
|
||||
var orig = ref.definition().orig;
|
||||
for (var i = orig.length; --i >= 0;) {
|
||||
if (orig[i] instanceof AST_SymbolConst) return true;
|
||||
}
|
||||
}
|
||||
|
||||
function find_variable(compressor, name) {
|
||||
var scope, i = 0;
|
||||
while (scope = compressor.parent(i++)) {
|
||||
@@ -804,8 +795,7 @@ merge(Compressor.prototype, {
|
||||
return make_node(AST_SymbolRef, expr.name, expr.name);
|
||||
}
|
||||
} else {
|
||||
var lhs = expr[expr instanceof AST_Assign ? "left" : "expression"];
|
||||
return !is_reference_const(lhs) && lhs;
|
||||
return expr[expr instanceof AST_Assign ? "left" : "expression"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1988,7 +1978,6 @@ merge(Compressor.prototype, {
|
||||
&& node instanceof AST_Assign
|
||||
&& node.operator == "="
|
||||
&& node.left instanceof AST_SymbolRef
|
||||
&& !is_reference_const(node.left)
|
||||
&& scope === self) {
|
||||
node.right.walk(tw);
|
||||
return true;
|
||||
@@ -3194,7 +3183,7 @@ merge(Compressor.prototype, {
|
||||
&& (left.operator == "++" || left.operator == "--")) {
|
||||
left = left.expression;
|
||||
} else left = null;
|
||||
if (!left || is_lhs_read_only(left) || is_reference_const(left)) {
|
||||
if (!left || is_lhs_read_only(left)) {
|
||||
expressions[++i] = cdr;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user