@@ -2727,19 +2727,25 @@ merge(Compressor.prototype, {
|
|||||||
return typeof function(){};
|
return typeof function(){};
|
||||||
}
|
}
|
||||||
if (!non_converting_unary[this.operator]) depth++;
|
if (!non_converting_unary[this.operator]) depth++;
|
||||||
e = e._eval(compressor, cached, depth);
|
var v = e._eval(compressor, cached, depth);
|
||||||
if (e === this.expression) return this;
|
if (v === this.expression) return this;
|
||||||
switch (this.operator) {
|
switch (this.operator) {
|
||||||
case "!": return !e;
|
case "!": return !v;
|
||||||
case "typeof":
|
case "typeof":
|
||||||
// typeof <RegExp> returns "object" or "function" on different platforms
|
// typeof <RegExp> returns "object" or "function" on different platforms
|
||||||
// so cannot evaluate reliably
|
// so cannot evaluate reliably
|
||||||
if (e instanceof RegExp) return this;
|
if (v instanceof RegExp) return this;
|
||||||
return typeof e;
|
return typeof v;
|
||||||
case "void": return void e;
|
case "void": return void v;
|
||||||
case "~": return ~e;
|
case "~": return ~v;
|
||||||
case "-": return -e;
|
case "-": return -v;
|
||||||
case "+": return +e;
|
case "+": return +v;
|
||||||
|
case "++":
|
||||||
|
case "--":
|
||||||
|
if (e instanceof AST_SymbolRef) {
|
||||||
|
var refs = e.definition().references;
|
||||||
|
if (refs[refs.length - 1] === e) return v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -947,7 +947,7 @@ collapse_vars_misc1: {
|
|||||||
function f8() { var b = window.a * window.z; return b + (b + 5) }
|
function f8() { var b = window.a * window.z; return b + (b + 5) }
|
||||||
function f9() { var b = window.a * window.z; return bar() || b }
|
function f9() { var b = window.a * window.z; return bar() || b }
|
||||||
function f10(x) { var a = 5; return a += 3; }
|
function f10(x) { var a = 5; return a += 3; }
|
||||||
function f11(x) { var a = 5, b = 3; return a += --b; }
|
function f11(x) { var a = 5; return a += 2; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user