Properly process try/finally blocks.
authorantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Feb 2011 11:40:48 +0000 (11:40 +0000)
committerantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Feb 2011 11:40:48 +0000 (11:40 +0000)
commit6b4ff18b5bc0c876f48c6e30d9385d0b20883ab0
treeb2ad1280592955127d625e09bef52e563a9ce583
parentfba910c31332ab33652dedcc37a1bfe0fda6b6eb
Properly process try/finally blocks.

In some circumstances, try/finally block can actually catch the exception:

function f() {
  try {
    throw 42;
  } finally {
    return 0;
  }
}

Therefore when propagating exception to v8::TryCatch, we must be sure
there is no try/finally blocks as well.

When bulding the messages we should be more conservative and expect that
any v8::TryCatch with no JS try/catch in between can potentionally
be the right exception handler.

Plus various minor refactorings.

BUG=1147
TEST=cctest/test-api/TryCatchAndFinallyHidingException, cctest/test-api/TryCatchAndFinally

Review URL: http://codereview.chromium.org/6526016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6809 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
samples/shell.cc
src/d8.cc
src/top.cc
src/top.h
test/cctest/test-api.cc