Index: src/debug/debug.cc |
diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
index de7cc2315d02397e85f54388772acf6f4da68b67..297156f563e0518c4f9a5e687324dc73c1378553 100644 |
--- a/src/debug/debug.cc |
+++ b/src/debug/debug.cc |
@@ -1815,6 +1815,7 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
void Debug::OnCompileError(Handle<Script> script) { |
if (ignore_events()) return; |
+ SuppressDebug while_processing(this); |
if (in_debug_scope()) { |
ProcessCompileEventInDebugScope(v8::CompileError, script); |
@@ -1857,6 +1858,7 @@ void Debug::OnDebugBreak(Handle<Object> break_points_hit, |
void Debug::OnBeforeCompile(Handle<Script> script) { |
if (in_debug_scope() || ignore_events()) return; |
+ SuppressDebug while_processing(this); |
HandleScope scope(isolate_); |
DebugScope debug_scope(this); |
@@ -1878,6 +1880,7 @@ void Debug::OnBeforeCompile(Handle<Script> script) { |
// Handle debugger actions when a new script is compiled. |
void Debug::OnAfterCompile(Handle<Script> script) { |
if (ignore_events()) return; |
+ SuppressDebug while_processing(this); |
if (in_debug_scope()) { |
ProcessCompileEventInDebugScope(v8::AfterCompile, script); |
@@ -1974,6 +1977,9 @@ void Debug::CallEventCallback(v8::DebugEvent event, |
Handle<Object> exec_state, |
Handle<Object> event_data, |
v8::Debug::ClientData* client_data) { |
+ // Prevent other interrupts from triggering, for example API callbacks, |
+ // while dispatching event listners. |
+ PostponeInterruptsScope postpone(isolate_); |
bool previous = in_debug_event_listener_; |
in_debug_event_listener_ = true; |
if (event_listener_->IsForeign()) { |
@@ -2007,7 +2013,6 @@ void Debug::ProcessCompileEventInDebugScope(v8::DebugEvent event, |
Handle<Script> script) { |
if (event_listener_.is_null()) return; |
- SuppressDebug while_processing(this); |
DebugScope debug_scope(this); |
if (debug_scope.failed()) return; |