Web Inspector: Modernize some function expressions that bind(this) to arrow functions
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2016 22:11:54 +0000 (22:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2016 22:11:54 +0000 (22:11 +0000)
commit72eedec385940883e0f600c74f100650b5a04eb5
treedbfa5cd636e8651ccb4471ac015df61b042453bf
parent13eaf1232e31af9d3efab5c1e202dc4a70954678
Web Inspector: Modernize some function expressions that bind(this) to arrow functions
https://bugs.webkit.org/show_bug.cgi?id=158315

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-02
Reviewed by Brian Burg.

Convert a common "function(x) { ... }.bind(this)" pattern to use arrow
functions "(x) => { ... }", which lexically binds `this`, slightly faster,
and uses less memory.

* UserInterface/Base/Main.js:
(WebInspector._updateNewTabButtonState):
* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
* UserInterface/Controllers/TypeTokenAnnotator.js:
(WebInspector.TypeTokenAnnotator.prototype.insertAnnotations):
(WebInspector.TypeTokenAnnotator.prototype.insertAnnotations.): Deleted.
* UserInterface/Models/RenderingFrameTimelineRecord.js:
(WebInspector.RenderingFrameTimelineRecord.prototype._calculateDurationRemainder):
(WebInspector.RenderingFrameTimelineRecord):
* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.requestContent):
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.requestScriptSyntaxTree):
(WebInspector.Script.prototype.requestScriptSyntaxTree.makeSyntaxTreeAndCallCallback): Deleted.
* UserInterface/Models/SourceCodeLocation.js:
(WebInspector.SourceCodeLocation.prototype.populateLiveDisplayLocationString):
* UserInterface/Models/WrappedPromise.js:
(WebInspector.WrappedPromise):
* UserInterface/Views/BreakpointActionView.js:
(WebInspector.BreakpointActionView.prototype._updateBody):
* UserInterface/Views/BreakpointTreeElement.js:
(WebInspector.BreakpointTreeElement.prototype._dataUpdated):
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers):
* UserInterface/Views/DefaultDashboardView.js:
(WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem.set item):
(WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem):
* UserInterface/Views/ErrorObjectView.js:
(WebInspector.ErrorObjectView.prototype.update):
* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.onattach):
(WebInspector.GeneralTreeElement.prototype.onattach.this._boundContextMenuEventHandler): Deleted.
* UserInterface/Views/InlineSwatch.js:
(WebInspector.InlineSwatch.prototype._getNextValidHEXFormat):
(WebInspector.InlineSwatch):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype.refresh):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._showPopoverForSelectedNode):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._contentForPopover):
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._mouseup):
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement.): Deleted.
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateEntries):
* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView.prototype._updateEntries):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.this._codeMirror.addKeyMap): Deleted.
* UserInterface/Views/TabBar.js:
* UserInterface/Views/VisualStylePropertyEditor.js:
(WebInspector.VisualStylePropertyEditor.prototype._checkDependencies):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js
Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js
Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Models/Script.js
Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js
Source/WebInspectorUI/UserInterface/Models/WrappedPromise.js
Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.js
Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js
Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.js
Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js
Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js
Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/TabBar.js
Source/WebInspectorUI/UserInterface/Views/VisualStylePropertyEditor.js