Fixes a bug where only the last breakpoint would be hit after reloading
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jun 2008 16:40:17 +0000 (16:40 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jun 2008 16:40:17 +0000 (16:40 +0000)
        the page. Also fixes a bug where disabled breakpoints would be hit
        after reloading the page.

        Reviewed by Darin Adler.

        * page/inspector/BreakpointsSidebarPane.js:
        (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint): Don't call
        InspectorController.addBreakpoint() unless the breakpoint is enabled.
        * page/inspector/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.addScript): Move the addBreakpoint()
        call inside the for loop so each breakpoint is added. Also check the
        breakpoint's enabled state before calling addBreakpoint().

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

WebCore/ChangeLog
WebCore/page/inspector/BreakpointsSidebarPane.js
WebCore/page/inspector/ScriptsPanel.js

index 1258719..143ece9 100644 (file)
@@ -1,5 +1,21 @@
 2008-06-02  Timothy Hatcher  <timothy@apple.com>
 
+        Fixes a bug where only the last breakpoint would be hit after reloading
+        the page. Also fixes a bug where disabled breakpoints would be hit
+        after reloading the page.
+
+        Reviewed by Darin Adler.
+
+        * page/inspector/BreakpointsSidebarPane.js:
+        (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint): Don't call
+        InspectorController.addBreakpoint() unless the breakpoint is enabled.
+        * page/inspector/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.addScript): Move the addBreakpoint()
+        call inside the for loop so each breakpoint is added. Also check the
+        breakpoint's enabled state before calling addBreakpoint().
+
+2008-06-02  Timothy Hatcher  <timothy@apple.com>
+
         Fixes a bug where the line highlight and the execution line were conflicting.
         The line highlight no longer shows up when the execution line changes, only
         when showResource or showScript is called with a line number.
index 69eaf4b..9f4be86 100644 (file)
@@ -48,7 +48,8 @@ WebInspector.BreakpointsSidebarPane.prototype = {
         if (!InspectorController.debuggerAttached() || !breakpoint.sourceID)
             return;
 
-        InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line);
+        if (breakpoint.enabled)
+            InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line);
     },
 
     removeBreakpoint: function(breakpoint)
index 018c3f4..3de9484 100644 (file)
@@ -218,11 +218,12 @@ WebInspector.ScriptsPanel.prototype = {
             var breakpointsLength = breakpoints.length;
             for (var i = 0; i < breakpointsLength; ++i) {
                 var breakpoint = breakpoints[i];
-                if (startingLine <= breakpoint.line)
+                if (startingLine <= breakpoint.line) {
                     breakpoint.sourceID = sourceID;
+                    if (breakpoint.enabled)
+                        InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line);
+                }
             }
-
-            InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line);
         }
 
         if (sourceID)