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

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

Issue 6820003: Allow recursive messages reporting as it is already used. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Yuri's concerns Created 9 years, 8 months 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
« src/messages.cc ('K') | « src/top.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 715dbdb26b518607e2d6994216bf922c4bdc89fc..d7621d12cf2ff1af6c02c36abd4c626b418eb612 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -8671,18 +8671,21 @@ static Handle<Value> ThrowingCallbackWithTryCatch(const Arguments& args) {
}
+static int call_depth;
+
+
static void WithTryCatch(Handle<Message> message, Handle<Value> data) {
TryCatch try_catch;
}
static void ThrowFromJS(Handle<Message> message, Handle<Value> data) {
- CompileRun("throw 'ThrowInJS';");
+ if (--call_depth) CompileRun("throw 'ThrowInJS';");
Vitaly Repeshko 2011/04/11 19:37:39 In case we re-entered this message callback, shoul
antonm 2011/04/15 12:15:34 I don't think it's important for the given test.
}
static void ThrowViaApi(Handle<Message> message, Handle<Value> data) {
- ThrowException(v8_str("ThrowViaApi"));
+ if (--call_depth) ThrowException(v8_str("ThrowViaApi"));
}
@@ -8708,6 +8711,7 @@ THREADED_TEST(ExceptionsDoNotPropagatePastTryCatch) {
if (callback != NULL) {
V8::AddMessageListener(callback);
}
+ call_depth = 5;
Vitaly Repeshko 2011/04/11 19:37:39 5 is arbitrary here, right? In any case, it'd be n
antonm 2011/04/15 12:15:34 Done.
ExpectFalse(
"var thrown = false;\n"
"try { func(); } catch(e) { thrown = true; }\n"
« src/messages.cc ('K') | « src/top.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698