Web Inspector: REGRESSION(r248201): DOMDebugger: unable to add event breakpoint when...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2019 03:52:38 +0000 (03:52 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2019 03:52:38 +0000 (03:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200561

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js

index 3b00e71..a793cf1 100644 (file)
@@ -1,5 +1,16 @@
 2019-08-12  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: REGRESSION(r248201): DOMDebugger: unable to add event breakpoint when All Events breakpoint is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=200561
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Controllers/DOMDebuggerManager.js:
+        (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
+        (WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
+
+2019-08-12  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: REGRESSION: DOMDebugger: breakpoints are forcibly enabled when resolving DOM breakpoints for newly added nodes
         https://bugs.webkit.org/show_bug.cgi?id=200639
 
index 5765c17..e027945 100644 (file)
@@ -368,7 +368,7 @@ WI.DOMDebuggerManager = class DOMDebuggerManager extends WI.Object
 
     addEventBreakpoint(breakpoint)
     {
-        console.assert(breakpoint instanceof WI.EventBreakpoint);
+        console.assert(breakpoint instanceof WI.EventBreakpoint, breakpoint);
         if (!breakpoint)
             return;
 
@@ -377,9 +377,10 @@ WI.DOMDebuggerManager = class DOMDebuggerManager extends WI.Object
             return;
         }
 
-        console.assert(breakpoint.type === WI.EventBreakpoint.Type.Listener);
+        console.assert(breakpoint.type === WI.EventBreakpoint.Type.Listener, breakpoint);
+        console.assert(breakpoint.eventName, breakpoint);
 
-        if (this.listenerBreakpointForEventName(breakpoint.eventName))
+        if (this._listenerBreakpoints.find((existing) => existing.eventName === breakpoint.eventName))
             return;
 
         this._listenerBreakpoints.push(breakpoint);
@@ -397,7 +398,7 @@ WI.DOMDebuggerManager = class DOMDebuggerManager extends WI.Object
 
     removeEventBreakpoint(breakpoint)
     {
-        console.assert(breakpoint instanceof WI.EventBreakpoint);
+        console.assert(breakpoint instanceof WI.EventBreakpoint, breakpoint);
         if (!breakpoint)
             return;
 
@@ -407,8 +408,10 @@ WI.DOMDebuggerManager = class DOMDebuggerManager extends WI.Object
             return;
         }
 
-        console.assert(breakpoint.type === WI.EventBreakpoint.Type.Listener);
+        console.assert(breakpoint.type === WI.EventBreakpoint.Type.Listener, breakpoint);
+        console.assert(breakpoint.eventName, breakpoint);
 
+        console.assert(this._listenerBreakpoints.includes(breakpoint), breakpoint);
         if (!this._listenerBreakpoints.includes(breakpoint))
             return;