// When scheduling a throw we first throw the exception to get the
// error reporting if it is uncaught before rescheduling it.
Throw(exception);
- PropagatePendingExceptionToExternalTryCatch();
- if (has_pending_exception()) {
- thread_local_top()->scheduled_exception_ = pending_exception();
- thread_local_top()->external_caught_exception_ = false;
- clear_pending_exception();
- }
+ thread_local_top()->scheduled_exception_ = pending_exception();
+ thread_local_top()->external_caught_exception_ = false;
+ clear_pending_exception();
}
}
-static void TryCatchNestedHelper(int depth) {
- if (depth > 0) {
- v8::TryCatch try_catch;
- try_catch.SetVerbose(true);
- TryCatchNestedHelper(depth - 1);
- CHECK(try_catch.HasCaught());
- try_catch.ReThrow();
- } else {
- v8::ThrowException(v8_str("back"));
- }
-}
-
-
-TEST(TryCatchNested) {
- v8::V8::Initialize();
- v8::HandleScope scope;
- LocalContext context;
- v8::TryCatch try_catch;
- TryCatchNestedHelper(5);
- CHECK(try_catch.HasCaught());
- CHECK_EQ(0, strcmp(*v8::String::Utf8Value(try_catch.Exception()), "back"));
-}
-
-
THREADED_TEST(Equality) {
v8::HandleScope scope;
LocalContext context;