| Index: test/cctest/test-debug.cc
|
| diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
|
| index 575f938594cbe6f9011d89c11838af29cefc9c9d..5d38a16aee6ef566ecce9664c3f37018a60869bc 100644
|
| --- a/test/cctest/test-debug.cc
|
| +++ b/test/cctest/test-debug.cc
|
| @@ -7594,3 +7594,29 @@ TEST(DebugPromiseRejectedByCallback) {
|
| CHECK(CompileRun("r")->Equals(v8_str("rejectedrejection")));
|
| CHECK_EQ(1, exception_event_counter);
|
| }
|
| +
|
| +
|
| +TEST(DebugBreakOnExceptionInObserveCallback) {
|
| + DebugLocalContext env;
|
| + v8::Isolate* isolate = env->GetIsolate();
|
| + v8::HandleScope scope(isolate);
|
| + v8::Debug::SetDebugEventListener(&DebugEventCountException);
|
| + // Break on uncaught exception
|
| + ChangeBreakOnException(false, true);
|
| + exception_event_counter = 0;
|
| +
|
| + v8::Handle<v8::FunctionTemplate> fun =
|
| + v8::FunctionTemplate::New(isolate, ThrowCallback);
|
| + env->Global()->Set(v8_str("fun"), fun->GetFunction());
|
| +
|
| + CompileRun(
|
| + "var obj = {};"
|
| + "var callbackRan = false;"
|
| + "Object.observe(obj, function() {"
|
| + " callbackRan = true;"
|
| + " throw Error('foo');"
|
| + "});"
|
| + "obj.prop = 1");
|
| + CHECK(CompileRun("callbackRan")->BooleanValue());
|
| + CHECK_EQ(1, exception_event_counter);
|
| +}
|
|
|