Rewrite temporary variable elimination
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
function foo() {
|
||||
throw "foo";
|
||||
}
|
||||
|
||||
function bar() {
|
||||
var $tmp = foo();
|
||||
try {
|
||||
return "result: " + $tmp;
|
||||
} catch (e) {
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
|
||||
function box() {
|
||||
try {
|
||||
bar()
|
||||
} catch (e) {
|
||||
if (e == "foo") {
|
||||
return "OK"
|
||||
}
|
||||
return e;
|
||||
}
|
||||
return "Exception expected";
|
||||
}
|
||||
Reference in New Issue
Block a user