@@ -1197,7 +1197,9 @@ merge(Compressor.prototype, {
|
|||||||
function find_loop_scope_try() {
|
function find_loop_scope_try() {
|
||||||
var node = compressor.self(), level = 0;
|
var node = compressor.self(), level = 0;
|
||||||
do {
|
do {
|
||||||
if (node instanceof AST_Catch || node instanceof AST_Finally) {
|
if (node instanceof AST_Catch) {
|
||||||
|
if (!compressor.parent(level).bfinally) level++;
|
||||||
|
} else if (node instanceof AST_Finally) {
|
||||||
level++;
|
level++;
|
||||||
} else if (node instanceof AST_IterationStatement) {
|
} else if (node instanceof AST_IterationStatement) {
|
||||||
in_loop = true;
|
in_loop = true;
|
||||||
|
|||||||
@@ -8280,3 +8280,40 @@ issue_3976: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4012: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
dead_code: true,
|
||||||
|
evaluate: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function(a) {
|
||||||
|
try {
|
||||||
|
throw 2;
|
||||||
|
} catch (b) {
|
||||||
|
a = "PASS";
|
||||||
|
if (--b)
|
||||||
|
return;
|
||||||
|
if (3);
|
||||||
|
} finally {
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function(a) {
|
||||||
|
try {
|
||||||
|
throw 2;
|
||||||
|
} catch (b) {
|
||||||
|
a = "PASS";
|
||||||
|
if (--b)
|
||||||
|
return;
|
||||||
|
if (3);
|
||||||
|
} finally {
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user