@@ -4448,15 +4448,16 @@ merge(Compressor.prototype, {
|
|||||||
push();
|
push();
|
||||||
segment.block = node;
|
segment.block = node;
|
||||||
walk_body(node, tw);
|
walk_body(node, tw);
|
||||||
|
pop();
|
||||||
if (node.bcatch) {
|
if (node.bcatch) {
|
||||||
var def = node.bcatch.argname.definition();
|
var def = node.bcatch.argname.definition();
|
||||||
references[def.id] = false;
|
references[def.id] = false;
|
||||||
if (def = def.redefined()) references[def.id] = false;
|
if (def = def.redefined()) references[def.id] = false;
|
||||||
pop();
|
|
||||||
push();
|
push();
|
||||||
|
if (node.bfinally) segment.block = node.bcatch;
|
||||||
walk_body(node.bcatch, tw);
|
walk_body(node.bcatch, tw);
|
||||||
}
|
|
||||||
pop();
|
pop();
|
||||||
|
}
|
||||||
if (node.bfinally) node.bfinally.walk(tw);
|
if (node.bfinally) node.bfinally.walk(tw);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2617,9 +2617,9 @@ issue_4126_1: {
|
|||||||
try {
|
try {
|
||||||
console.log("PASS");
|
console.log("PASS");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
var c = a;
|
var b = a;
|
||||||
} finally {
|
} finally {
|
||||||
var c = c;
|
var c = b;
|
||||||
}
|
}
|
||||||
console.log(c);
|
console.log(c);
|
||||||
}
|
}
|
||||||
@@ -2860,3 +2860,71 @@ issue_4155: {
|
|||||||
"function",
|
"function",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4157_1: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
loops: true,
|
||||||
|
merge_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
for (var a = "FAIL"; a; a++)
|
||||||
|
return;
|
||||||
|
var b = 0;
|
||||||
|
} finally {
|
||||||
|
console.log(b);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
var a = "FAIL";
|
||||||
|
if (a)
|
||||||
|
return;
|
||||||
|
var b = 0;
|
||||||
|
} finally {
|
||||||
|
console.log(b);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_4157_2: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
loops: true,
|
||||||
|
merge_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
throw "FAIL";
|
||||||
|
} catch (e) {
|
||||||
|
for (var a = e; a; a++)
|
||||||
|
return;
|
||||||
|
var b = 0;
|
||||||
|
} finally {
|
||||||
|
console.log(b);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
throw "FAIL";
|
||||||
|
} catch (e) {
|
||||||
|
var a = e;
|
||||||
|
if (a)
|
||||||
|
return;
|
||||||
|
var b = 0;
|
||||||
|
} finally {
|
||||||
|
console.log(b);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_stdout: "undefined"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user