Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index ab44af7f934aae2a2dde02dcdc2f7545d5ca5d26..93cdce62075fd689a1496499f95dd900d183f73a 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -21863,3 +21863,34 @@ TEST(EstimatedContextSize) { |
LocalContext env; |
CHECK(50000 < env->EstimatedSize()); |
} |
+ |
+ |
+static int nb_uncaught_exception_callback_calls = 0; |
+ |
+ |
+bool NoAbortOnUncaughtException(v8::Isolate* isolate) { |
+ ++nb_uncaught_exception_callback_calls; |
+ return false; |
+} |
+ |
+ |
+TEST(AbortOnUncaughtExceptionNoAbort) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope handle_scope(isolate); |
+ v8::Handle<v8::ObjectTemplate> global_template = |
+ v8::ObjectTemplate::New(isolate); |
+ LocalContext env(NULL, global_template); |
+ |
+ i::FLAG_abort_on_uncaught_exception = true; |
+ isolate->SetAbortOnUncaughtExceptionCallback(NoAbortOnUncaughtException); |
+ |
+ CompileRun("function boom() { throw new Error(\"boom\") }"); |
+ |
+ v8::Local<v8::Object> global_object = env->Global(); |
+ v8::Local<v8::Function> foo = |
+ v8::Local<v8::Function>::Cast(global_object->Get(v8_str("boom"))); |
+ |
+ foo->Call(global_object, 0, NULL); |
+ |
+ CHECK_EQ(1, nb_uncaught_exception_callback_calls); |
+} |