@@ -6433,6 +6433,7 @@ merge(Compressor.prototype, {
|
|||||||
OPT(AST_Assign, function(self, compressor) {
|
OPT(AST_Assign, function(self, compressor) {
|
||||||
if (compressor.option("dead_code")) {
|
if (compressor.option("dead_code")) {
|
||||||
if (self.left instanceof AST_PropAccess) {
|
if (self.left instanceof AST_PropAccess) {
|
||||||
|
if (self.operator == "=") {
|
||||||
var exp = self.left.expression;
|
var exp = self.left.expression;
|
||||||
if (exp instanceof AST_Lambda
|
if (exp instanceof AST_Lambda
|
||||||
|| !compressor.has_directive("use strict")
|
|| !compressor.has_directive("use strict")
|
||||||
@@ -6443,6 +6444,7 @@ merge(Compressor.prototype, {
|
|||||||
self.right
|
self.right
|
||||||
]).optimize(compressor);
|
]).optimize(compressor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (self.left instanceof AST_SymbolRef) {
|
} else if (self.left instanceof AST_SymbolRef) {
|
||||||
var def = self.left.definition();
|
var def = self.left.definition();
|
||||||
if (def.scope === compressor.find_parent(AST_Lambda)) {
|
if (def.scope === compressor.find_parent(AST_Lambda)) {
|
||||||
|
|||||||
@@ -1042,3 +1042,25 @@ function_assign: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3552: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
pure_getters: "strict",
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "PASS";
|
||||||
|
(function() {
|
||||||
|
(1..p += 42) && (a = "FAIL");
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "PASS";
|
||||||
|
(function() {
|
||||||
|
(1..p += 42) && (a = "FAIL");
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user