@@ -7436,6 +7436,7 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!(parent instanceof AST_UnaryPrefix && parent.operator == "delete")) {
|
||||||
if (self.left instanceof AST_Number && !self.right.is_constant()) switch (self.operator) {
|
if (self.left instanceof AST_Number && !self.right.is_constant()) switch (self.operator) {
|
||||||
// 0 + n => n
|
// 0 + n => n
|
||||||
case "+":
|
case "+":
|
||||||
@@ -7488,6 +7489,7 @@ merge(Compressor.prototype, {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (compressor.option("typeofs")) switch (self.operator) {
|
if (compressor.option("typeofs")) switch (self.operator) {
|
||||||
case "&&":
|
case "&&":
|
||||||
mark_locally_defined(self.left, self.right, null);
|
mark_locally_defined(self.left, self.right, null);
|
||||||
|
|||||||
@@ -2833,3 +2833,39 @@ issue_3997: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "string"
|
expect_stdout: "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4035: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 0;
|
||||||
|
(function() {
|
||||||
|
var b = --a;
|
||||||
|
console.log(delete (0 + b));
|
||||||
|
console.log(delete (1 * b));
|
||||||
|
console.log(delete (b + 0));
|
||||||
|
console.log(delete (b - 0));
|
||||||
|
console.log(delete (b / 1));
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 0;
|
||||||
|
(function() {
|
||||||
|
var b = --a;
|
||||||
|
console.log((0 + b, true));
|
||||||
|
console.log((1 * b, true));
|
||||||
|
console.log((0 + b, true));
|
||||||
|
console.log((b - 0, true));
|
||||||
|
console.log((b / 1, true));
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"true",
|
||||||
|
"true",
|
||||||
|
"true",
|
||||||
|
"true",
|
||||||
|
"true",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user