@@ -5030,6 +5030,7 @@ Compressor.prototype.compress = function(node) {
|
|||||||
if (def.undeclared) return this;
|
if (def.undeclared) return this;
|
||||||
if (def.last_ref !== lhs) return this;
|
if (def.last_ref !== lhs) return this;
|
||||||
if (def.single_use == "m") return this;
|
if (def.single_use == "m") return this;
|
||||||
|
if (this.right.has_side_effects(compressor)) return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var op = this.operator;
|
var op = this.operator;
|
||||||
|
|||||||
@@ -3390,3 +3390,29 @@ issue_5380: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5558: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
evaluate: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
sequences: true,
|
||||||
|
toplevel: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 99, b = 0;
|
||||||
|
a++;
|
||||||
|
b++;
|
||||||
|
b += a;
|
||||||
|
b *= a;
|
||||||
|
b += a;
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 99, b = 0;
|
||||||
|
b++,
|
||||||
|
b = (b += ++a) * a + a,
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "100"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user