AST_Catch shouldn't really inherit from AST_Scope. Fix #363

I hereby acknowledge that figure_out_scope has become a mess.
This commit is contained in:
Mihai Bazon
2013-12-05 13:30:29 +02:00
parent d2190c2bf3
commit 8f35a363d9
3 changed files with 55 additions and 5 deletions

View File

@@ -119,3 +119,47 @@ unused_keep_setter_arg: {
}
}
}
unused_var_in_catch: {
options = { unused: true };
input: {
function foo() {
try {
foo();
} catch(ex) {
var x = 10;
}
}
}
expect: {
function foo() {
try {
foo();
} catch(ex) {}
}
}
}
used_var_in_catch: {
options = { unused: true };
input: {
function foo() {
try {
foo();
} catch(ex) {
var x = 10;
}
return x;
}
}
expect: {
function foo() {
try {
foo();
} catch(ex) {
var x = 10;
}
return x;
}
}
}