Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: test/cctest/test-api.cc

Issue 11299329: Fix external exceptions in external try-catch handlers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index aa85e2a899e35f6bd0d2e201816f48d1af7956db..1dbc399479ed02dc2a7183a88b5bec1d32b97729 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -3720,6 +3720,30 @@ THREADED_TEST(TryCatchAndFinally) {
}
+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;
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698