@@ -5431,15 +5431,15 @@ Compressor.prototype.compress = function(node) {
|
||||
}
|
||||
}
|
||||
def(AST_SymbolRef, function(compressor, ignore_side_effects, cached, depth) {
|
||||
this._eval = return_this;
|
||||
try {
|
||||
var fixed = this.fixed_value();
|
||||
if (!fixed) return this;
|
||||
var value;
|
||||
if (HOP(fixed, "_eval")) {
|
||||
value = fixed._eval();
|
||||
} else {
|
||||
this._eval = return_this;
|
||||
value = fixed._eval(compressor, ignore_side_effects, cached, depth);
|
||||
delete this._eval;
|
||||
if (value === fixed) return this;
|
||||
fixed._eval = function() {
|
||||
return value;
|
||||
@@ -5447,6 +5447,9 @@ Compressor.prototype.compress = function(node) {
|
||||
cached.push(fixed);
|
||||
}
|
||||
return value && typeof value == "object" && !verify_escaped(this, depth) ? this : value;
|
||||
} finally {
|
||||
delete this._eval;
|
||||
}
|
||||
});
|
||||
var global_objs = {
|
||||
Array: Array,
|
||||
|
||||
@@ -3069,3 +3069,41 @@ issue_5651: {
|
||||
expect_stdout: true
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_5774: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
conditionals: true,
|
||||
evaluate: true,
|
||||
join_vars: true,
|
||||
reduce_vars: true,
|
||||
sequences: true,
|
||||
unsafe: true,
|
||||
}
|
||||
input: {
|
||||
(function() {
|
||||
while (console.log("PASS")) {
|
||||
if (console) {
|
||||
a = void 0;
|
||||
var b = void 0;
|
||||
var c = void 0;
|
||||
([ a = 0 ] = [ b, b ]);
|
||||
var a;
|
||||
}
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function() {
|
||||
while (console.log("PASS")) {
|
||||
var a, b, c, a;
|
||||
console && (
|
||||
c = b = a = void 0,
|
||||
[ a = 0 ] = [ a, a ]
|
||||
);
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user