@@ -1585,13 +1585,19 @@ merge(Compressor.prototype, {
|
|||||||
var found = false;
|
var found = false;
|
||||||
return statements[stat_index].transform(new TreeTransformer(function(node, descend, in_list) {
|
return statements[stat_index].transform(new TreeTransformer(function(node, descend, in_list) {
|
||||||
if (found) return node;
|
if (found) return node;
|
||||||
if (node === expr || node.body === expr) {
|
if (node !== expr && node.body !== expr) return;
|
||||||
found = true;
|
|
||||||
if (node instanceof AST_VarDef) {
|
if (node instanceof AST_VarDef) {
|
||||||
|
found = true;
|
||||||
node.value = null;
|
node.value = null;
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
return in_list ? MAP.skip : null;
|
if (in_list) {
|
||||||
|
found = true;
|
||||||
|
return MAP.skip;
|
||||||
|
}
|
||||||
|
if (!this.parent()) {
|
||||||
|
found = true;
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}, function(node) {
|
}, function(node) {
|
||||||
if (node instanceof AST_Sequence) switch (node.expressions.length) {
|
if (node instanceof AST_Sequence) switch (node.expressions.length) {
|
||||||
|
|||||||
@@ -2315,3 +2315,33 @@ issue_3125: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3274: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
inline: true,
|
||||||
|
join_vars: true,
|
||||||
|
loops: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function() {
|
||||||
|
var g = function(a) {
|
||||||
|
var c = a.p, b = c;
|
||||||
|
return b != c;
|
||||||
|
};
|
||||||
|
while (g(1))
|
||||||
|
console.log("FAIL");
|
||||||
|
console.log("PASS");
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function() {
|
||||||
|
for (var c; void 0, (c = 1..p) != c;)
|
||||||
|
console.log("FAIL");
|
||||||
|
console.log("PASS");
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user