@@ -853,18 +853,21 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
function walk_prop(node) {
|
function walk_prop(lhs) {
|
||||||
if (node instanceof AST_Dot) {
|
if (lhs instanceof AST_Dot) {
|
||||||
walk_prop(node.expression);
|
walk_prop(lhs.expression);
|
||||||
} else if (node instanceof AST_Sub) {
|
} else if (lhs instanceof AST_Sub) {
|
||||||
walk_prop(node.expression);
|
walk_prop(lhs.expression);
|
||||||
node.property.walk(tw);
|
lhs.property.walk(tw);
|
||||||
} else if (node instanceof AST_SymbolRef) {
|
} else if (lhs instanceof AST_SymbolRef) {
|
||||||
var d = node.definition();
|
var d = lhs.definition();
|
||||||
push_ref(d, node);
|
push_ref(d, lhs);
|
||||||
node.fixed = d.fixed;
|
if (d.fixed) {
|
||||||
|
lhs.fixed = d.fixed;
|
||||||
|
lhs.fixed.assigns = [ node ];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
node.walk(tw);
|
lhs.walk(tw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3212,3 +3212,30 @@ issue_4628: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "undefined"
|
expect_stdout: "undefined"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4653: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
merge_vars: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
toplevel: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 1, b;
|
||||||
|
function f(c, d) {
|
||||||
|
c || console.log(d);
|
||||||
|
}
|
||||||
|
f(a++ + (b = b), b |= console.log(a));
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var b = 1;
|
||||||
|
(function(c, d) {
|
||||||
|
c || console.log(d);
|
||||||
|
})(+b + (b = void 0), b |= console.log(2));
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"2",
|
||||||
|
"0",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user