andreasgal/j2me.js — pull request #607 by yxl (2014-11-17 10:57:25+00:00)
Title: Handle nested try-catch-finally block correctly. Fix #396

There is a bug when the vm handling nested try-catch-finally blocks.
For the following code. There is a try-finally inside another try-finally. When an exception thrown from the inner try-finally, execution will goes into the outer `finally` other than the inner `finally`.
```java
void foo() throws Exception {
try {
try {
throw new Exception();
} finally {
System.out.println("inner finally reached!");
}
} finally {
System.out.println("outer finally reached!");
}
}
```

Another similar case is that to use `synchronized` block with try-catch-finally block. The `synchronized` block implies a try-catch-block when compiled to byte codes. So for the following code, the inner `finally` could not be reached due to this VM bug:
```java
private void foo1() throws Exception {
synchronized(this) {
try {
throw new Exception();
} finally {
foo1Reached = true;
System.out.println("foo1 inner finally reached!");
}
}
}
```