@@ -7276,6 +7276,7 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function retain_lhs(node) {
|
function retain_lhs(node) {
|
||||||
|
if (node instanceof AST_DefaultValue) return retain_lhs(node.name);
|
||||||
if (node instanceof AST_Destructured) {
|
if (node instanceof AST_Destructured) {
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
value = make_node(AST_Number, node, { value: 0 });
|
value = make_node(AST_Number, node, { value: 0 });
|
||||||
@@ -7289,7 +7290,6 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
return make_node(AST_DestructuredObject, node, { properties: [] });
|
return make_node(AST_DestructuredObject, node, { properties: [] });
|
||||||
}
|
}
|
||||||
if (node instanceof AST_DefaultValue) node = node.name;
|
|
||||||
node.__unused = null;
|
node.__unused = null;
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ evaluate: {
|
|||||||
} while (false);
|
} while (false);
|
||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
for(;;)
|
for (;;)
|
||||||
a();
|
a();
|
||||||
for(;;)
|
for (;;)
|
||||||
c();
|
c();
|
||||||
d();
|
d();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -943,10 +943,63 @@ issue_4666: {
|
|||||||
expect: {
|
expect: {
|
||||||
var a = 0, b = 0;
|
var a = 0, b = 0;
|
||||||
var o = (c => +a + c)([ b ]);
|
var o = (c => +a + c)([ b ]);
|
||||||
for(var k in o)
|
for (var k in o)
|
||||||
b++;
|
b++;
|
||||||
console.log(1, b);
|
console.log(1, b);
|
||||||
}
|
}
|
||||||
expect_stdout: "1 2"
|
expect_stdout: "1 2"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5089_1: {
|
||||||
|
options = {
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var {
|
||||||
|
p: [] = 42,
|
||||||
|
...o
|
||||||
|
} = {
|
||||||
|
p: [],
|
||||||
|
};
|
||||||
|
console.log(o.p);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var {
|
||||||
|
p: {},
|
||||||
|
...o
|
||||||
|
} = {
|
||||||
|
p: 0,
|
||||||
|
};
|
||||||
|
console.log(o.p);
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5089_2: {
|
||||||
|
options = {
|
||||||
|
pure_getters: "strict",
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var {
|
||||||
|
p: {} = null,
|
||||||
|
...o
|
||||||
|
} = {
|
||||||
|
p: {},
|
||||||
|
};
|
||||||
|
console.log(o.p);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var {
|
||||||
|
p: {},
|
||||||
|
...o
|
||||||
|
} = {
|
||||||
|
p: 0,
|
||||||
|
};
|
||||||
|
console.log(o.p);
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ while_if_break: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
for(; a && (b && c && d, !e););
|
for (; a && (b && c && d, !e););
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user