@@ -616,7 +616,11 @@ merge(Compressor.prototype, {
|
|||||||
if (node instanceof AST_DestructuredObject) {
|
if (node instanceof AST_DestructuredObject) {
|
||||||
var save = fixed;
|
var save = fixed;
|
||||||
node.properties.forEach(function(node) {
|
node.properties.forEach(function(node) {
|
||||||
if (node.key instanceof AST_Node) node.key.walk(tw);
|
if (node.key instanceof AST_Node) {
|
||||||
|
push(tw);
|
||||||
|
node.key.walk(tw);
|
||||||
|
pop(tw);
|
||||||
|
}
|
||||||
fixed = function() {
|
fixed = function() {
|
||||||
var key = node.key;
|
var key = node.key;
|
||||||
var type = AST_Sub;
|
var type = AST_Sub;
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ funarg_reduce_vars_3: {
|
|||||||
(function({
|
(function({
|
||||||
[a++]: b
|
[a++]: b
|
||||||
}) {})(0);
|
}) {})(0);
|
||||||
console.log(1);
|
console.log(a);
|
||||||
}
|
}
|
||||||
expect_stdout: "1"
|
expect_stdout: "1"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
@@ -1317,3 +1317,27 @@ issue_4280: {
|
|||||||
expect_stdout: "undefined"
|
expect_stdout: "undefined"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4282: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function(a) {
|
||||||
|
({
|
||||||
|
[a = "bar"]: 0[console.log(a)],
|
||||||
|
} = 0);
|
||||||
|
})("foo");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function(a) {
|
||||||
|
({
|
||||||
|
[a = "bar"]: 0[console.log(a)],
|
||||||
|
} = 0);
|
||||||
|
})("foo");
|
||||||
|
}
|
||||||
|
expect_stdout: true
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user