Changeset 196464 in webkit


Ignore:
Timestamp:
Feb 11, 2016 9:17:12 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: SourceCodeTextEditor close() generates removeEventListener warnings
https://bugs.webkit.org/show_bug.cgi?id=154150

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-02-11
Reviewed by Timothy Hatcher.

  • UserInterface/Views/SourceCodeTextEditor.js:

(WebInspector.SourceCodeTextEditor.prototype.close):
Remove the event listeners in the cases that we would have added them.
If we have SourceMap information we should remove the key listener,
and if we don't we should remove the SourceMapAdded listener.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r196406 r196464  
     12016-02-11  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: SourceCodeTextEditor close() generates removeEventListener warnings
     4        https://bugs.webkit.org/show_bug.cgi?id=154150
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/SourceCodeTextEditor.js:
     9        (WebInspector.SourceCodeTextEditor.prototype.close):
     10        Remove the event listeners in the cases that we would have added them.
     11        If we have SourceMap information we should remove the key listener,
     12        and if we don't we should remove the SourceMapAdded listener.
     13
    1142016-02-10  Timothy Hatcher  <timothy@apple.com>
    215
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js

    r193926 r196464  
    140140        WebInspector.issueManager.removeEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
    141141
    142         WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
    143         this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
     142        if (this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length > 0)
     143            WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
     144        else
     145            this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
    144146    }
    145147
Note: See TracChangeset for help on using the changeset viewer.