@@ -9293,12 +9293,16 @@ merge(Compressor.prototype, {
|
|||||||
node = parent;
|
node = parent;
|
||||||
parent = compressor.parent(level++);
|
parent = compressor.parent(level++);
|
||||||
if (parent instanceof AST_Assign) {
|
if (parent instanceof AST_Assign) {
|
||||||
if (parent.left instanceof AST_PropAccess) break;
|
var found = false;
|
||||||
if (!(parent.left instanceof AST_SymbolRef)) continue;
|
if (parent.left.match_symbol(function(node) {
|
||||||
if (parent.left.definition() !== def) continue;
|
if (node instanceof AST_PropAccess) return true;
|
||||||
if (in_try(level, parent)) break;
|
if (!found && node instanceof AST_SymbolRef && node.definition() === def) {
|
||||||
def.fixed = false;
|
if (in_try(level, parent)) return true;
|
||||||
return strip_assignment();
|
def.fixed = false;
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
})) break;
|
||||||
|
if (found) return strip_assignment();
|
||||||
} else if (parent instanceof AST_Exit) {
|
} else if (parent instanceof AST_Exit) {
|
||||||
if (!local) break;
|
if (!local) break;
|
||||||
if (in_try(level, parent)) break;
|
if (in_try(level, parent)) break;
|
||||||
|
|||||||
@@ -1806,3 +1806,41 @@ issue_4355: {
|
|||||||
expect_stdout: "2"
|
expect_stdout: "2"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4372_1: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "FAIL";
|
||||||
|
a += {
|
||||||
|
[console.log(a)]: a,
|
||||||
|
} = a = "PASS";
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "FAIL";
|
||||||
|
a += {
|
||||||
|
[console.log(a)]: a,
|
||||||
|
} = a = "PASS";
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_4372_2: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a;
|
||||||
|
[ a ] = a = [ "PASS", "FAIL" ];
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a;
|
||||||
|
[ a ] = [ "PASS", "FAIL" ];
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user