haileys / twostroke

A Javascript implementation in Ruby!
MIT License
303 stars 19 forks source link

Breaking out of a try block fails #9

Open int3 opened 10 years ago

int3 commented 10 years ago
while (true) {
    try {
        break;
    } catch (e) {}
}

throw 1;

The above code seems to get stuck in an infinite loop.

I haven't looked into what exactly is causing it, but I think having a runtime stack of exception handlers is a problematic design, because the 'pop handler' instruction may get jumped over.