Title: [158404] trunk/Source/WebInspectorUI
Revision
158404
Author
[email protected]
Date
2013-10-31 16:12:10 -0700 (Thu, 31 Oct 2013)

Log Message

Web Inspector: Breakpoints in auto-formatted _javascript_ editors are not working
https://bugs.webkit.org/show_bug.cgi?id=123589

Patch by Joseph Pecoraro <[email protected]> on 2013-10-31
Reviewed by Timothy Hatcher.

The internal this._ignoreCodeMirrorContentDidChangeEvent flag was being used
in two places that could be nested, meaning the flag was deleted while it
was still expected to be set. Change it instead to a counter, to handle nesting.

* UserInterface/TextEditor.js:
(WebInspector.TextEditor):
(WebInspector.TextEditor.prototype.set string):
(WebInspector.TextEditor.prototype.set formatted):
(WebInspector.TextEditor.prototype._contentChanged):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (158403 => 158404)


--- trunk/Source/WebInspectorUI/ChangeLog	2013-10-31 22:57:34 UTC (rev 158403)
+++ trunk/Source/WebInspectorUI/ChangeLog	2013-10-31 23:12:10 UTC (rev 158404)
@@ -1,5 +1,22 @@
 2013-10-31  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Breakpoints in auto-formatted _javascript_ editors are not working
+        https://bugs.webkit.org/show_bug.cgi?id=123589
+
+        Reviewed by Timothy Hatcher.
+
+        The internal this._ignoreCodeMirrorContentDidChangeEvent flag was being used
+        in two places that could be nested, meaning the flag was deleted while it
+        was still expected to be set. Change it instead to a counter, to handle nesting.
+
+        * UserInterface/TextEditor.js:
+        (WebInspector.TextEditor):
+        (WebInspector.TextEditor.prototype.set string):
+        (WebInspector.TextEditor.prototype.set formatted):
+        (WebInspector.TextEditor.prototype._contentChanged):
+
+2013-10-31  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Remove stale optional native memory instrumentation protocol params
         https://bugs.webkit.org/show_bug.cgi?id=123552
 

Modified: trunk/Source/WebInspectorUI/UserInterface/TextEditor.js (158403 => 158404)


--- trunk/Source/WebInspectorUI/UserInterface/TextEditor.js	2013-10-31 22:57:34 UTC (rev 158403)
+++ trunk/Source/WebInspectorUI/UserInterface/TextEditor.js	2013-10-31 23:12:10 UTC (rev 158404)
@@ -61,6 +61,7 @@
     this._searchQuery = null;
     this._searchResults = [];
     this._currentSearchResultIndex = -1;
+    this._ignoreCodeMirrorContentDidChangeEvent = 0;
 
     this._formatted = false;
     this._formatterSourceMap = null;
@@ -134,9 +135,10 @@
             this._revealPendingPositionIfPossible();
         }
 
-        this._ignoreCodeMirrorContentDidChangeEvent = true;
+        this._ignoreCodeMirrorContentDidChangeEvent++;
         this._codeMirror.operation(update.bind(this));
-        delete this._ignoreCodeMirrorContentDidChangeEvent;
+        this._ignoreCodeMirrorContentDidChangeEvent--;
+        console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
     },
 
     get readOnly()
@@ -163,9 +165,10 @@
         if (formatted && !this.canBeFormatted())
             return;
 
-        this._ignoreCodeMirrorContentDidChangeEvent = true;
+        this._ignoreCodeMirrorContentDidChangeEvent++;
         this._prettyPrint(formatted);
-        delete this._ignoreCodeMirrorContentDidChangeEvent;
+        this._ignoreCodeMirrorContentDidChangeEvent--;
+        console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
 
         this._formatted = formatted;
 
@@ -592,7 +595,7 @@
 
     _contentChanged: function(codeMirror, change)
     {
-        if (this._ignoreCodeMirrorContentDidChangeEvent)
+        if (this._ignoreCodeMirrorContentDidChangeEvent > 0)
             return;
 
         if (this._formatted) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to