Changeset 158404 in webkit


Ignore:
Timestamp:
Oct 31, 2013 4:12:10 PM (10 years ago)
Author:
commit-queue@webkit.org
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 <Joseph Pecoraro> 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):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r158356 r158404  
     12013-10-31  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Breakpoints in auto-formatted JavaScript editors are not working
     4        https://bugs.webkit.org/show_bug.cgi?id=123589
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        The internal this._ignoreCodeMirrorContentDidChangeEvent flag was being used
     9        in two places that could be nested, meaning the flag was deleted while it
     10        was still expected to be set. Change it instead to a counter, to handle nesting.
     11
     12        * UserInterface/TextEditor.js:
     13        (WebInspector.TextEditor):
     14        (WebInspector.TextEditor.prototype.set string):
     15        (WebInspector.TextEditor.prototype.set formatted):
     16        (WebInspector.TextEditor.prototype._contentChanged):
     17
    1182013-10-31  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/TextEditor.js

    r157966 r158404  
    6262    this._searchResults = [];
    6363    this._currentSearchResultIndex = -1;
     64    this._ignoreCodeMirrorContentDidChangeEvent = 0;
    6465
    6566    this._formatted = false;
     
    135136        }
    136137
    137         this._ignoreCodeMirrorContentDidChangeEvent = true;
     138        this._ignoreCodeMirrorContentDidChangeEvent++;
    138139        this._codeMirror.operation(update.bind(this));
    139         delete this._ignoreCodeMirrorContentDidChangeEvent;
     140        this._ignoreCodeMirrorContentDidChangeEvent--;
     141        console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
    140142    },
    141143
     
    164166            return;
    165167
    166         this._ignoreCodeMirrorContentDidChangeEvent = true;
     168        this._ignoreCodeMirrorContentDidChangeEvent++;
    167169        this._prettyPrint(formatted);
    168         delete this._ignoreCodeMirrorContentDidChangeEvent;
     170        this._ignoreCodeMirrorContentDidChangeEvent--;
     171        console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
    169172
    170173        this._formatted = formatted;
     
    593596    _contentChanged: function(codeMirror, change)
    594597    {
    595         if (this._ignoreCodeMirrorContentDidChangeEvent)
     598        if (this._ignoreCodeMirrorContentDidChangeEvent > 0)
    596599            return;
    597600
Note: See TracChangeset for help on using the changeset viewer.