@@ -1258,7 +1258,7 @@ merge(Compressor.prototype, {
|
|||||||
col: node.start.col
|
col: node.start.col
|
||||||
});
|
});
|
||||||
if (candidate instanceof AST_UnaryPostfix) {
|
if (candidate instanceof AST_UnaryPostfix) {
|
||||||
delete candidate.expression.fixed;
|
lhs.definition().fixed = false;
|
||||||
return make_node(AST_UnaryPrefix, candidate, candidate);
|
return make_node(AST_UnaryPrefix, candidate, candidate);
|
||||||
}
|
}
|
||||||
if (candidate instanceof AST_VarDef) {
|
if (candidate instanceof AST_VarDef) {
|
||||||
|
|||||||
@@ -7977,7 +7977,7 @@ mangleable_var: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
issue_3884: {
|
issue_3884_1: {
|
||||||
options = {
|
options = {
|
||||||
collapse_vars: true,
|
collapse_vars: true,
|
||||||
evaluate: true,
|
evaluate: true,
|
||||||
@@ -7995,9 +7995,33 @@ issue_3884: {
|
|||||||
console.log(a, b);
|
console.log(a, b);
|
||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
var a = 100;
|
var a = 100, b = 1;
|
||||||
++a;
|
b <<= ++a;
|
||||||
console.log(a, 32);
|
console.log(a, b);
|
||||||
|
}
|
||||||
|
expect_stdout: "101 32"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_3884_2: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
evaluate: true,
|
||||||
|
passes: 3,
|
||||||
|
reduce_vars: true,
|
||||||
|
side_effects: true,
|
||||||
|
toplevel: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 100, b = 1;
|
||||||
|
{
|
||||||
|
a++ + a || a;
|
||||||
|
b <<= a;
|
||||||
|
}
|
||||||
|
console.log(a, b);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(101, 32);
|
||||||
}
|
}
|
||||||
expect_stdout: "101 32"
|
expect_stdout: "101 32"
|
||||||
}
|
}
|
||||||
@@ -8195,3 +8219,26 @@ operator_in: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3971: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
evaluate: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
side_effects: true,
|
||||||
|
toplevel: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 0 == typeof f, b = 0;
|
||||||
|
{
|
||||||
|
var a = void (a++ + (b |= a));
|
||||||
|
}
|
||||||
|
console.log(b);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 0 == typeof f, b = 0;
|
||||||
|
var a = void (b |= ++a);
|
||||||
|
console.log(b);
|
||||||
|
}
|
||||||
|
expect_stdout: "1"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user