Skip to content
Permalink
Browse files
Web Inspector: SourceCodeTextEditor close() generates removeEventList…
…ener warnings

https://bugs.webkit.org/show_bug.cgi?id=154150

Patch by Joseph Pecoraro <pecoraro@apple.com> 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.

Canonical link: https://commits.webkit.org/172253@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JosephPecoraro authored and webkit-commit-queue committed Feb 12, 2016
1 parent 0be2cef commit d9aaf26bedadd0288c3deabe60d385daee1d0d16
Showing with 17 additions and 2 deletions.
  1. +13 −0 Source/WebInspectorUI/ChangeLog
  2. +4 −2 Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
@@ -1,3 +1,16 @@
2016-02-11 Joseph Pecoraro <pecoraro@apple.com>

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

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.

2016-02-10 Timothy Hatcher <timothy@apple.com>

Web Inspector: Add new icon for the Timeline Recording navigation bar item
@@ -139,8 +139,10 @@ WebInspector.SourceCodeTextEditor = class SourceCodeTextEditor extends WebInspec

WebInspector.issueManager.removeEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);

WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
if (this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length > 0)
WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
else
this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
}

canBeFormatted()

0 comments on commit d9aaf26

Please sign in to comment.