Index: src/debug.h |
diff --git a/src/debug.h b/src/debug.h |
index b8348fd52af0dbd4656e4ea88ec3535d1656591b..ea17cb0e9c82c9f2844c3267d7d89d511409bb1a 100644 |
--- a/src/debug.h |
+++ b/src/debug.h |
@@ -515,6 +515,9 @@ class Debug { |
// Check whether there are commands in the command queue. |
inline bool has_commands() const { return !command_queue_.IsEmpty(); } |
inline bool ignore_events() const { return is_suppressed_ || !is_active_; } |
+ inline bool break_disabled() const { |
+ return break_disabled_ || in_debug_event_listener_; |
+ } |
void OnException(Handle<Object> exception, bool uncaught, |
Handle<Object> promise); |
@@ -592,6 +595,7 @@ class Debug { |
bool live_edit_enabled_; |
bool has_break_points_; |
bool break_disabled_; |
+ bool in_debug_event_listener_; |
bool break_on_exception_; |
bool break_on_uncaught_exception_; |
@@ -702,14 +706,21 @@ class DebugScope BASE_EMBEDDED { |
class DisableBreak BASE_EMBEDDED { |
public: |
explicit DisableBreak(Debug* debug, bool disable_break) |
- : debug_(debug), old_state_(debug->break_disabled_) { |
+ : debug_(debug), |
+ previous_break_disabled_(debug->break_disabled_), |
+ previous_in_debug_event_listener_(debug->in_debug_event_listener_) { |
debug_->break_disabled_ = disable_break; |
+ debug_->in_debug_event_listener_ = disable_break; |
+ } |
+ ~DisableBreak() { |
+ debug_->break_disabled_ = previous_break_disabled_; |
+ debug_->in_debug_event_listener_ = previous_in_debug_event_listener_; |
} |
- ~DisableBreak() { debug_->break_disabled_ = old_state_; } |
private: |
Debug* debug_; |
- bool old_state_; |
+ bool previous_break_disabled_; |
+ bool previous_in_debug_event_listener_; |
DISALLOW_COPY_AND_ASSIGN(DisableBreak); |
}; |