Chromium Code Reviews| 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" |