Title: [201630] trunk/Source/WebInspectorUI
Revision
201630
Author
[email protected]
Date
2016-06-02 18:18:59 -0700 (Thu, 02 Jun 2016)

Log Message

Web Inspector: Modernize Array.prototype.every/some callsites to arrow functions
https://bugs.webkit.org/show_bug.cgi?id=158330

Patch by Joseph Pecoraro <[email protected]> on 2016-06-02
Reviewed by Brian Burg.

* UserInterface/Controllers/DOMTreeManager.js:
(WebInspector.DOMTreeManager.prototype._updateContentFlowFromPayload):
* UserInterface/Models/ProfileNode.js:
(WebInspector.ProfileNode):
* UserInterface/Models/ScopeChainNode.js:
(WebInspector.ScopeChainNode):
* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace):
* UserInterface/Models/StructureDescription.js:
(WebInspector.StructureDescription):
* UserInterface/Models/TypeDescription.js:
(WebInspector.TypeDescription):
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackend.Command.prototype.supports):
* UserInterface/Views/ContentViewContainer.js:
(WebInspector.ContentViewContainer.prototype.showContentView):
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie.treeElementMatchesCookie):
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
* UserInterface/Views/ScopeBar.js:
(WebInspector.ScopeBar.prototype.get selectedItems):
(WebInspector.ScopeBar.prototype.hasNonDefaultItemSelected):
* UserInterface/Views/TabContentView.js:
(WebInspector.TabContentView):
(WebInspector.TabContentView.console.assert): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (201629 => 201630)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-03 01:18:59 UTC (rev 201630)
@@ -1,5 +1,38 @@
 2016-06-02  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Modernize Array.prototype.every/some callsites to arrow functions
+        https://bugs.webkit.org/show_bug.cgi?id=158330
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Controllers/DOMTreeManager.js:
+        (WebInspector.DOMTreeManager.prototype._updateContentFlowFromPayload):
+        * UserInterface/Models/ProfileNode.js:
+        (WebInspector.ProfileNode):
+        * UserInterface/Models/ScopeChainNode.js:
+        (WebInspector.ScopeChainNode):
+        * UserInterface/Models/StackTrace.js:
+        (WebInspector.StackTrace):
+        * UserInterface/Models/StructureDescription.js:
+        (WebInspector.StructureDescription):
+        * UserInterface/Models/TypeDescription.js:
+        (WebInspector.TypeDescription):
+        * UserInterface/Protocol/InspectorBackend.js:
+        (InspectorBackend.Command.prototype.supports):
+        * UserInterface/Views/ContentViewContainer.js:
+        (WebInspector.ContentViewContainer.prototype.showContentView):
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie.treeElementMatchesCookie):
+        (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
+        * UserInterface/Views/ScopeBar.js:
+        (WebInspector.ScopeBar.prototype.get selectedItems):
+        (WebInspector.ScopeBar.prototype.hasNonDefaultItemSelected):
+        * UserInterface/Views/TabContentView.js:
+        (WebInspector.TabContentView):
+        (WebInspector.TabContentView.console.assert): Deleted.
+
+2016-06-02  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Modernize some function expressions that bind(this) to arrow functions
         https://bugs.webkit.org/show_bug.cgi?id=158315
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -493,7 +493,7 @@
     _updateContentFlowFromPayload(contentFlow, flowPayload)
     {
         console.assert(contentFlow.contentNodes.length === flowPayload.content.length);
-        console.assert(contentFlow.contentNodes.every(function(node, i) { return node.id === flowPayload.content[i]; }));
+        console.assert(contentFlow.contentNodes.every((node, i) => node.id === flowPayload.content[i]));
 
         // FIXME: Collect the regions from the payload.
         contentFlow.overset = flowPayload.overset;

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -34,9 +34,9 @@
         console.assert(id);
         console.assert(!calls || calls instanceof Array);
         console.assert(!calls || calls.length >= 1);
-        console.assert(!calls || calls.every(function(call) { return call instanceof WebInspector.ProfileNodeCall; }));
+        console.assert(!calls || calls.every((call) => call instanceof WebInspector.ProfileNodeCall));
         console.assert(childNodes instanceof Array);
-        console.assert(childNodes.every(function(node) { return node instanceof WebInspector.ProfileNode; }));
+        console.assert(childNodes.every((node) => node instanceof WebInspector.ProfileNode));
 
         this._id = id;
         this._type = type || WebInspector.ProfileNode.Type.Function;

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -30,7 +30,7 @@
         super();
 
         console.assert(typeof type === "string");
-        console.assert(objects.every(function(x) { return x instanceof WebInspector.RemoteObject; }));
+        console.assert(objects.every((x) => x instanceof WebInspector.RemoteObject));
 
         if (type in WebInspector.ScopeChainNode.Type)
             type = WebInspector.ScopeChainNode.Type[type];

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/StackTrace.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -29,7 +29,7 @@
     {
         super();
 
-        console.assert(callFrames && callFrames.every(function(callFrame) { return callFrame instanceof WebInspector.CallFrame; }));
+        console.assert(callFrames && callFrames.every((callFrame) => callFrame instanceof WebInspector.CallFrame));
 
         this._callFrames = callFrames;
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/StructureDescription.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -29,8 +29,8 @@
     {
         super();
 
-        console.assert(!fields || fields.every(function(x) { return typeof x === "string"; }));
-        console.assert(!optionalFields || optionalFields.every(function(x) { return typeof x === "string"; }));
+        console.assert(!fields || fields.every((x) => typeof x === "string"));
+        console.assert(!optionalFields || optionalFields.every((x) => typeof x === "string"));
         console.assert(!constructorName || typeof constructorName === "string");
         console.assert(!prototypeStructure || prototypeStructure instanceof WebInspector.StructureDescription);
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -31,7 +31,7 @@
 
         console.assert(!leastCommonAncestor || typeof leastCommonAncestor === "string");
         console.assert(!typeSet || typeSet instanceof WebInspector.TypeSet);
-        console.assert(!structures || structures.every(function(x) { return x instanceof WebInspector.StructureDescription; }));
+        console.assert(!structures || structures.every((x) => x instanceof WebInspector.StructureDescription));
 
         this._leastCommonAncestor = leastCommonAncestor || null;
         this._typeSet = typeSet || null;

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -526,9 +526,7 @@
         'use strict';
 
         var instance = this._instance;
-        return instance.callSignature.some(function(parameter) {
-            return parameter["name"] === parameterName;
-        });
+        return instance.callSignature.some((parameter) => parameter["name"] === parameterName);
     },
 
     // Private

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -127,10 +127,7 @@
         // Disassociate with the removed content views.
         for (let i = 0; i < removedEntries.length; ++i) {
             // Skip disassociation if this content view is still in the back/forward list.
-            let shouldDissociateContentView = !this._backForwardList.some(function(existingEntry) {
-                return existingEntry.contentView === removedEntries[i].contentView;
-            });
-
+            let shouldDissociateContentView = !this._backForwardList.some((existingEntry) => existingEntry.contentView === removedEntries[i].contentView);
             if (shouldDissociateContentView)
                 this._disassociateFromContentView(removedEntries[i].contentView, removedEntries[i].tombstone);
         }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -758,18 +758,17 @@
                 representedObject.saveIdentityToCookie(candidateObjectCookie);
 
             var candidateCookieKeys = Object.keys(candidateObjectCookie);
-            return candidateCookieKeys.length && candidateCookieKeys.every(function valuesMatchForKey(key) {
-                return candidateObjectCookie[key] === cookie[key];
-            });
+            return candidateCookieKeys.length && candidateCookieKeys.every((key) => candidateObjectCookie[key] === cookie[key]);
         }
 
         var matchedElement = null;
-        treeElements.some(function(element) {
+        treeElements.some((element) => {
             if (treeElementMatchesCookie.call(this, element)) {
                 matchedElement = element;
                 return true;
             }
-        }, this);
+            return false;
+        });
 
         if (matchedElement) {
             let didShowContentView = this.showDefaultContentViewForTreeElement(matchedElement);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -81,16 +81,12 @@
 
     get selectedItems()
     {
-        return this._items.filter(function(item) {
-            return item.selected;
-        });
+        return this._items.filter((item) => item.selected);
     }
 
     hasNonDefaultItemSelected()
     {
-        return this._items.some(function(item) {
-            return item.selected && item !== this._defaultItem;
-        }, this);
+        return this._items.some((item) => item.selected && item !== this._defaultItem);
     }
 
     // Private

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js (201629 => 201630)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js	2016-06-03 00:39:58 UTC (rev 201629)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabContentView.js	2016-06-03 01:18:59 UTC (rev 201630)
@@ -28,10 +28,10 @@
     constructor(identifier, styleClassNames, tabBarItem, navigationSidebarPanel, detailsSidebarPanels)
     {
         console.assert(typeof identifier === "string");
-        console.assert(typeof styleClassNames === "string" || styleClassNames.every(function(className) { return typeof className === "string"; }));
+        console.assert(typeof styleClassNames === "string" || styleClassNames.every((className) => typeof className === "string"));
         console.assert(tabBarItem instanceof WebInspector.TabBarItem);
         console.assert(!navigationSidebarPanel || navigationSidebarPanel instanceof WebInspector.NavigationSidebarPanel);
-        console.assert(!detailsSidebarPanels || detailsSidebarPanels.every(function(detailsSidebarPanel) { return detailsSidebarPanel instanceof WebInspector.DetailsSidebarPanel; }));
+        console.assert(!detailsSidebarPanels || detailsSidebarPanels.every((detailsSidebarPanel) => detailsSidebarPanel instanceof WebInspector.DetailsSidebarPanel));
 
         super(null);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to