Web Inspector: Adopt Array.prototype.includes and String.prototype.includes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Mar 2015 16:38:00 +0000 (16:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Mar 2015 16:38:00 +0000 (16:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143176

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-28
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
Remove our custom implementations of Array/String contains functions.

* UserInterface/Base/Main.js:
(WebInspector._updateContentViewForCurrentNavigationSidebar):
(WebInspector._contentBrowserCurrentContentViewDidChange):
* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.):
(WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._updateHoveredTokenInfo):
(WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager.prototype._extraDomainsActivated):
(WebInspector.FrameResourceManager):
* UserInterface/Controllers/LayerTreeManager.js:
(WebInspector.LayerTreeManager.prototype.layerTreeMutations):
* UserInterface/Controllers/StorageManager.js:
(WebInspector.StorageManager.prototype._extraDomainsActivated):
(WebInspector.StorageManager):
* UserInterface/Models/Branch.js:
(WebInspector.Branch.prototype.addRevision):
* UserInterface/Models/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.forProperty):
* UserInterface/Models/CSSRule.js:
(WebInspector.CSSRule.prototype.get matchedSelectors):
* UserInterface/Models/CSSStyleDeclaration.js:
* UserInterface/Models/Color.js:
(WebInspector.Color.fromString):
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._updatePseudoClassCheckboxes):
(WebInspector.CSSStyleDetailsSidebarPanel):
* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._updateContentViewSelectionPathNavigationItem):
* UserInterface/Views/DOMTreeElement.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._resourceAdded):
* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.addClassName):
(WebInspector.GeneralTreeElement.prototype.removeClassName):
* UserInterface/Views/LegacyConsoleMessageImpl.js:
(WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsTable):
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._updateMessagesSelection):
* UserInterface/Views/NavigationBar.js:
(WebInspector.NavigationBar.prototype._findNavigationItem):
* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.findSidebarPanel):
Replace contains with includes where appropriate.

LayoutTests:

* inspector/css/pseudo-element-matches.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182113 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/css/pseudo-element-matches.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Base/Utilities.js
Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js
Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js
Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js
Source/WebInspectorUI/UserInterface/Controllers/LayerTreeManager.js
Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js
Source/WebInspectorUI/UserInterface/Models/Branch.js
Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js
Source/WebInspectorUI/UserInterface/Models/CSSRule.js
Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
Source/WebInspectorUI/UserInterface/Models/Color.js
Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/NavigationBar.js
Source/WebInspectorUI/UserInterface/Views/Sidebar.js

index 5c624d1..a70edb9 100644 (file)
@@ -1,3 +1,12 @@
+2015-03-28  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Adopt Array.prototype.includes and String.prototype.includes
+        https://bugs.webkit.org/show_bug.cgi?id=143176
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/css/pseudo-element-matches.html:
+
 2015-03-28  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         REGRESSION(r181326): It made dfg-int16array.js and dfg-int8array.js fail on AArch64 Linux
index 6077182..f2599de 100644 (file)
@@ -20,7 +20,7 @@ function test() {
             found = true;
             var index = 0;
             for (var selector of rule.selectors) {
-                var matches = rule.matchedSelectorIndices.contains(index);
+                var matches = rule.matchedSelectorIndices.includes(index);
                 InspectorTest.log(selector.text + (matches ? " MATCHES" : ""));
                 index++;
             }
index a7442f7..25df6e1 100644 (file)
@@ -1,5 +1,67 @@
 2015-03-28  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Adopt Array.prototype.includes and String.prototype.includes
+        https://bugs.webkit.org/show_bug.cgi?id=143176
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Utilities.js:
+        Remove our custom implementations of Array/String contains functions.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector._updateContentViewForCurrentNavigationSidebar):
+        (WebInspector._contentBrowserCurrentContentViewDidChange):
+        * UserInterface/Controllers/CodeMirrorCompletionController.js:
+        (WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.):
+        (WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
+        * UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
+        (WebInspector.CodeMirrorTokenTrackingController.prototype._updateHoveredTokenInfo):
+        (WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
+        * UserInterface/Controllers/FrameResourceManager.js:
+        (WebInspector.FrameResourceManager.prototype._extraDomainsActivated):
+        (WebInspector.FrameResourceManager):
+        * UserInterface/Controllers/LayerTreeManager.js:
+        (WebInspector.LayerTreeManager.prototype.layerTreeMutations):
+        * UserInterface/Controllers/StorageManager.js:
+        (WebInspector.StorageManager.prototype._extraDomainsActivated):
+        (WebInspector.StorageManager):
+        * UserInterface/Models/Branch.js:
+        (WebInspector.Branch.prototype.addRevision):
+        * UserInterface/Models/CSSKeywordCompletions.js:
+        (WebInspector.CSSKeywordCompletions.forProperty):
+        * UserInterface/Models/CSSRule.js:
+        (WebInspector.CSSRule.prototype.get matchedSelectors):
+        * UserInterface/Models/CSSStyleDeclaration.js:
+        * UserInterface/Models/Color.js:
+        (WebInspector.Color.fromString):
+        * UserInterface/Models/DOMNode.js:
+        * UserInterface/Models/DOMNodeStyles.js:
+        (WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
+        * UserInterface/Views/CSSStyleDeclarationSection.js:
+        (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
+        * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
+        (WebInspector.CSSStyleDetailsSidebarPanel.prototype._updatePseudoClassCheckboxes):
+        (WebInspector.CSSStyleDetailsSidebarPanel):
+        * UserInterface/Views/ContentBrowser.js:
+        (WebInspector.ContentBrowser.prototype._updateContentViewSelectionPathNavigationItem):
+        * UserInterface/Views/DOMTreeElement.js:
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._resourceAdded):
+        * UserInterface/Views/GeneralTreeElement.js:
+        (WebInspector.GeneralTreeElement.prototype.addClassName):
+        (WebInspector.GeneralTreeElement.prototype.removeClassName):
+        * UserInterface/Views/LegacyConsoleMessageImpl.js:
+        (WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsTable):
+        * UserInterface/Views/LogContentView.js:
+        (WebInspector.LogContentView.prototype._updateMessagesSelection):
+        * UserInterface/Views/NavigationBar.js:
+        (WebInspector.NavigationBar.prototype._findNavigationItem):
+        * UserInterface/Views/Sidebar.js:
+        (WebInspector.Sidebar.prototype.findSidebarPanel):
+        Replace contains with includes where appropriate.
+
+2015-03-28  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: Tweak node styles in ObjectTreeView
         https://bugs.webkit.org/show_bug.cgi?id=143179
 
index 95b8f9c..19a2f29 100644 (file)
@@ -948,7 +948,7 @@ WebInspector._updateContentViewForCurrentNavigationSidebar = function()
     // Ensure the navigation sidebar panel is allowed by the current content view, if not ask the sidebar panel
     // to show the content view for the current selection.
     var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
-    if (allowedNavigationSidebarPanels && (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))) {
+    if (allowedNavigationSidebarPanels && (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.includes(selectedSidebarPanel.identifier))) {
         this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
         return;
     }
@@ -958,7 +958,7 @@ WebInspector._updateContentViewForCurrentNavigationSidebar = function()
     while (index--) {
         var contentView = backForwardList[index].contentView;
         var allowedNavigationSidebarPanels = contentView.allowedNavigationSidebarPanels;
-        if (allowedNavigationSidebarPanels && (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))) {
+        if (allowedNavigationSidebarPanels && (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.includes(selectedSidebarPanel.identifier))) {
             WebInspector.contentBrowser.showContentView(contentView);
             return;
         }
@@ -1116,8 +1116,8 @@ WebInspector._contentBrowserCurrentContentViewDidChange = function(event)
     var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
 
     if (allowedNavigationSidebarPanels) {
-        if (allowedNavigationSidebarPanels.length && !allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier)) {
-            console.assert(!currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels.contains(currentContentView.__lastNavigationSidebarPanelIdentifier));
+        if (allowedNavigationSidebarPanels.length && !allowedNavigationSidebarPanels.includes(selectedSidebarPanelIdentifier)) {
+            console.assert(!currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels.includes(currentContentView.__lastNavigationSidebarPanelIdentifier));
             this.navigationSidebar.selectedSidebarPanel = currentContentView.__lastNavigationSidebarPanelIdentifier || allowedNavigationSidebarPanels[0];
             console.assert(this.navigationSidebar.selectedSidebarPanel);
         }
index 537838a..70d9484 100644 (file)
@@ -393,14 +393,6 @@ Object.defineProperty(DocumentFragment.prototype, "createChild",
     value: Element.prototype.createChild
 });
 
-Object.defineProperty(Array.prototype, "contains",
-{
-    value: function(value)
-    {
-        return this.indexOf(value) !== -1;
-    }
-});
-
 Object.defineProperty(Array.prototype, "lastValue",
 {
     get: function()
@@ -436,14 +428,6 @@ Object.defineProperty(Array.prototype, "keySet",
     }
 });
 
-Object.defineProperty(String.prototype, "contains",
-{
-    value: function(value)
-    {
-        return this.indexOf(value) !== -1;
-    }
-});
-
 Object.defineProperty(String.prototype, "trimMiddle",
 {
     value: function(maxLength)
index 2ec0cfc..75aa268 100644 (file)
@@ -596,7 +596,7 @@ WebInspector.CodeMirrorCompletionController = class CodeMirrorCompletionControll
                     if (declaringVariable && variable.name === prefix)
                         continue;
 
-                    if (variable.name.startsWith(prefix) && !matchingWords.contains(variable.name))
+                    if (variable.name.startsWith(prefix) && !matchingWords.includes(variable.name))
                         matchingWords.push(variable.name);
                 }
             }
index e55782a..a5a9403 100644 (file)
@@ -296,7 +296,7 @@ WebInspector.CodeMirrorTokenTrackingController = class CodeMirrorTokenTrackingCo
 
         if (!token || !token.type || !token.string) {
             if (this._hoveredMarker && this._delegate && typeof this._delegate.tokenTrackingControllerMouseOutOfHoveredMarker === "function") {
-                if (!this._codeMirror.findMarksAt(position).contains(this._hoveredMarker.codeMirrorTextMarker))
+                if (!this._codeMirror.findMarksAt(position).includes(this._hoveredMarker.codeMirrorTextMarker))
                     this._delegate.tokenTrackingControllerMouseOutOfHoveredMarker(this, this._hoveredMarker);
             }
 
@@ -471,13 +471,13 @@ WebInspector.CodeMirrorTokenTrackingController = class CodeMirrorTokenTrackingCo
                 break;
 
             var isDot = !token.type && token.string === ".";
-            var isExpression = token.type && token.type.contains("m-javascript");
+            var isExpression = token.type && token.type.includes("m-javascript");
             if (!isDot && !isExpression)
                 break;
 
             // Disallow operators. We want the hovered expression to be just a single operand.
             // Also, some operators can modify values, such as pre-increment and assignment operators.
-            if (isExpression && token.type.contains("operator"))
+            if (isExpression && token.type.includes("operator"))
                 break;
 
             expression = token.string + expression;
index 664285c..511158e 100644 (file)
@@ -580,7 +580,7 @@ WebInspector.FrameResourceManager = class FrameResourceManager extends WebInspec
 
     _extraDomainsActivated(event)
     {
-        if (event.data.domains.contains("Page") && window.PageAgent)
+        if (event.data.domains.includes("Page") && window.PageAgent)
             PageAgent.getResourceTree(this._processMainFrameResourceTreePayload.bind(this));
     }
 };
index d6e44fc..48ec5f1 100644 (file)
@@ -86,7 +86,7 @@ WebInspector.LayerTreeManager = class LayerTreeManager extends WebInspector.Obje
         newLayers.forEach(function(layer) {
             layerIdsInNewLayers.push(layer.layerId);
 
-            var existed = layerIdsInPreviousLayers.contains(layer.layerId);
+            var existed = layerIdsInPreviousLayers.includes(layer.layerId);
 
             var nodeId = nodeIdForLayer(layer);
             if (!nodeId)
@@ -94,10 +94,10 @@ WebInspector.LayerTreeManager = class LayerTreeManager extends WebInspector.Obje
 
             if (layer.isReflection) {
                 nodeIdsForReflectionsInNewLayers.push(nodeId);
-                existed = existed || nodeIdsForReflectionsInPreviousLayers.contains(nodeId);
+                existed = existed || nodeIdsForReflectionsInPreviousLayers.includes(nodeId);
             } else {
                 nodeIdsInNewLayers.push(nodeId);
-                existed = existed || nodeIdsInPreviousLayers.contains(nodeId);
+                existed = existed || nodeIdsInPreviousLayers.includes(nodeId);
             }
 
             if (existed)
@@ -110,9 +110,9 @@ WebInspector.LayerTreeManager = class LayerTreeManager extends WebInspector.Obje
             var nodeId = nodeIdForLayer(layer);
 
             if (layer.isReflection)
-                return !nodeIdsForReflectionsInNewLayers.contains(nodeId);
+                return !nodeIdsForReflectionsInNewLayers.includes(nodeId);
             else
-                return !nodeIdsInNewLayers.contains(nodeId) && !layerIdsInNewLayers.contains(layer.layerId);
+                return !nodeIdsInNewLayers.includes(nodeId) && !layerIdsInNewLayers.includes(layer.layerId);
         });
 
         return {preserved, additions, removals};
index c4fb48e..eba689b 100644 (file)
@@ -298,8 +298,7 @@ WebInspector.StorageManager = class StorageManager extends WebInspector.Object
 
     _extraDomainsActivated(event)
     {
-        
-        if (event.data.domains.contains("DOMStorage") && window.DOMStorageAgent && DOMStorageAgent.getDOMStorageItems)
+        if (event.data.domains.includes("DOMStorage") && window.DOMStorageAgent && DOMStorageAgent.getDOMStorageItems)
             WebInspector.Frame.addEventListener(WebInspector.Frame.Event.SecurityOriginDidChange, this._securityOriginDidChange, this);
     }
 };
index 73d9515..829764b 100644 (file)
@@ -90,7 +90,7 @@ WebInspector.Branch = class Branch extends WebInspector.Object
         if (this._locked)
             return;
 
-        if (this._revisions.contains(revision))
+        if (this._revisions.includes(revision))
             return;
 
         this._revisions.push(revision);
index 866ea4b..98d669c 100644 (file)
@@ -54,7 +54,7 @@ WebInspector.CSSKeywordCompletions.forProperty = function(propertyName)
     else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions.InheritedProperties)
         acceptedKeywords.push("inherit");
 
-    if (acceptedKeywords.contains(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder)) {
+    if (acceptedKeywords.includes(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder)) {
         acceptedKeywords.remove(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder);
         acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSCompletions.cssNameCompletions.values);
     }
index 6f3873b..8c185d0 100644 (file)
@@ -142,7 +142,7 @@ WebInspector.CSSRule = class CSSRule extends WebInspector.Object
             return this._matchedSelectors;
 
         this._matchedSelectors = this._selectors.filter(function(element, index) {
-            return this._matchedSelectorIndices.contains(index);
+            return this._matchedSelectorIndices.includes(index);
         }, this);
 
         return this._matchedSelectors;
index fb0c63e..94078cf 100644 (file)
@@ -124,7 +124,7 @@ WebInspector.CSSStyleDeclaration = class CSSStyleDeclaration extends WebInspecto
         for (var i = 0; i < oldProperties.length; ++i) {
             var oldProperty = oldProperties[i];
 
-            if (!this._properties.contains(oldProperty)) {
+            if (!this._properties.includes(oldProperty)) {
                 // Clear the index, since it is no longer valid.
                 oldProperty.index = NaN;
 
@@ -142,7 +142,7 @@ WebInspector.CSSStyleDeclaration = class CSSStyleDeclaration extends WebInspecto
 
         var addedProperties = [];
         for (var i = 0; i < this._properties.length; ++i) {
-            if (!oldProperties.contains(this._properties[i]))
+            if (!oldProperties.includes(this._properties[i]))
                 addedProperties.push(this._properties[i]);
         }
 
index 8f3be6c..ae93827 100644 (file)
@@ -49,7 +49,7 @@ WebInspector.Color = class Color
     {
         var value = colorString.toLowerCase().replace(/%|\s+/g, "");
         var transparentNicknames = ["transparent", "rgba(0,0,0,0)", "hsla(0,0,0,0)"];
-        if (transparentNicknames.contains(value)) {
+        if (transparentNicknames.includes(value)) {
             var color = new WebInspector.Color(WebInspector.Color.Format.Nickname, [0, 0, 0, 0]);
             color.nickname = "transparent";
             color.original = colorString;
index 3057f9a..bd5d3bd 100644 (file)
@@ -553,11 +553,11 @@ WebInspector.DOMNode = class DOMNode extends WebInspector.Object
     {
         var pseudoClasses = this._enabledPseudoClasses;
         if (enabled) {
-            if (pseudoClasses.contains(pseudoClass))
+            if (pseudoClasses.includes(pseudoClass))
                 return;
             pseudoClasses.push(pseudoClass);
         } else {
-            if (!pseudoClasses.contains(pseudoClass))
+            if (!pseudoClasses.includes(pseudoClass))
                 return;
             pseudoClasses.remove(pseudoClass);
         }
index 0f1a983..4b5ffc5 100644 (file)
@@ -391,7 +391,7 @@ WebInspector.DOMNodeStyles = class DOMNodeStyles extends WebInspector.Object
 
             style.__pendingText = text;
 
-            if (!this._stylesNeedingTextCommited.contains(style))
+            if (!this._stylesNeedingTextCommited.includes(style))
                 this._stylesNeedingTextCommited.push(style);
 
             return;
@@ -617,7 +617,7 @@ WebInspector.DOMNodeStyles = class DOMNodeStyles extends WebInspector.Object
             // If the previous and current maps differ then make sure the found styleDeclaration is added to the current map.
             styleDeclarations = mapKey && mapKey in this._styleDeclarationsMap ? this._styleDeclarationsMap[mapKey] : [];
 
-            if (styleDeclaration && !styleDeclarations.contains(styleDeclaration)) {
+            if (styleDeclaration && !styleDeclarations.includes(styleDeclaration)) {
                 styleDeclarations.push(styleDeclaration);
                 this._styleDeclarationsMap[mapKey] = styleDeclarations;
             }
index 84ffcdf..3ec9341 100644 (file)
@@ -217,7 +217,7 @@ WebInspector.CSSStyleDeclarationSection.prototype = {
             var alwaysMatch = !matchedSelectorIndices.length;
             if (selectors.length) {
                 for (var i = 0; i < selectors.length; ++i) {
-                    appendSelector.call(this, selectors[i], alwaysMatch || matchedSelectorIndices.contains(i));
+                    appendSelector.call(this, selectors[i], alwaysMatch || matchedSelectorIndices.includes(i));
                     if (i < selectors.length - 1)
                         this._selectorElement.appendChild(document.createTextNode(", "));
                 }
index 1288027..2bad972 100644 (file)
@@ -221,7 +221,7 @@ WebInspector.CSSStyleDetailsSidebarPanel = class CSSStyleDetailsSidebarPanel ext
 
         for (var pseudoClass in this._forcedPseudoClassCheckboxes) {
             var checkboxElement = this._forcedPseudoClassCheckboxes[pseudoClass];
-            checkboxElement.checked = enabledPseudoClasses.contains(pseudoClass);
+            checkboxElement.checked = enabledPseudoClasses.includes(pseudoClass);
         }
     }
 };
index ea6044f..1dcb6d7 100644 (file)
@@ -383,7 +383,7 @@ WebInspector.ContentBrowser.prototype = {
         }
 
         // Insert the _contentViewSelectionPathNavigationItem after the _hierarchicalPathNavigationItem, if needed.
-        if (!this._navigationBar.navigationItems.contains(this._contentViewSelectionPathNavigationItem)) {
+        if (!this._navigationBar.navigationItems.includes(this._contentViewSelectionPathNavigationItem)) {
             var hierarchicalPathItemIndex = this._navigationBar.navigationItems.indexOf(this._hierarchicalPathNavigationItem);
             console.assert(hierarchicalPathItemIndex !== -1);
             this._navigationBar.insertNavigationItem(this._contentViewSelectionPathNavigationItem, hierarchicalPathItemIndex + 1);
index 268428e..f3408db 100644 (file)
@@ -614,7 +614,7 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
         // These strings don't need to be localized as they are CSS pseudo-classes.
         WebInspector.CSSStyleManager.ForceablePseudoClasses.forEach(function(pseudoClass) {
             var label = pseudoClass.capitalize();
-            var enabled = enabledPseudoClasses.contains(pseudoClass);
+            var enabled = enabledPseudoClasses.includes(pseudoClass);
             subMenu.appendCheckboxItem(label, function() {
                 node.setPseudoClassEnabled(pseudoClass, !enabled);
             }, enabled, false);
index 5a7e704..9f51959 100644 (file)
@@ -335,7 +335,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec
     {
         var resource = event.data.resource;
 
-        if (![WebInspector.Resource.Type.Document, WebInspector.Resource.Type.Script].contains(resource.type))
+        if (![WebInspector.Resource.Type.Document, WebInspector.Resource.Type.Script].includes(resource.type))
             return;
 
         this._addTreeElementForSourceCodeToContentTreeOutline(resource);
index 394577e..c386411 100644 (file)
@@ -94,7 +94,7 @@ WebInspector.GeneralTreeElement = class GeneralTreeElement extends WebInspector.
 
     addClassName(className)
     {
-        if (this._classNames.contains(className))
+        if (this._classNames.includes(className))
             return;
 
         this._classNames.push(className);
@@ -105,7 +105,7 @@ WebInspector.GeneralTreeElement = class GeneralTreeElement extends WebInspector.
 
     removeClassName(className)
     {
-        if (!this._classNames.contains(className))
+        if (!this._classNames.includes(className))
             return;
 
         this._classNames.remove(className);
index b65aaa1..80a8b45 100644 (file)
@@ -396,7 +396,7 @@ WebInspector.LegacyConsoleMessageImpl.prototype = {
                 const maxColumnsToRender = 10;
                 for (var j = 0; j < rowPreview.propertyPreviews.length; ++j) {
                     var cellProperty = rowPreview.propertyPreviews[j];
-                    var columnRendered = columnNames.contains(cellProperty.name);
+                    var columnRendered = columnNames.includes(cellProperty.name);
                     if (!columnRendered) {
                         if (userProvidedColumnNames || columnNames.length === maxColumnsToRender)
                             continue;
index 95563a9..5801edf 100644 (file)
@@ -482,7 +482,7 @@ WebInspector.LogContentView.prototype = {
 
     _updateMessagesSelection: function(message, multipleSelection, rangeSelection, shouldScrollIntoView)
     {
-        var alreadySelectedMessage = this._selectedMessages.contains(message);
+        var alreadySelectedMessage = this._selectedMessages.includes(message);
         if (alreadySelectedMessage && this._selectedMessages.length && multipleSelection) {
             message.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
             this._selectedMessages.remove(message);
index fb3362a..2d85def 100644 (file)
@@ -256,7 +256,7 @@ WebInspector.NavigationBar.prototype = {
         var navigationItem = null;
 
         if (navigationItemOrIdentifierOrIndex instanceof WebInspector.NavigationItem) {
-            if (this._navigationItems.contains(navigationItemOrIdentifierOrIndex))
+            if (this._navigationItems.includes(navigationItemOrIdentifierOrIndex))
                 navigationItem = navigationItemOrIdentifierOrIndex;
         } else if (typeof navigationItemOrIdentifierOrIndex === "number") {
             navigationItem = this._navigationItems[navigationItemOrIdentifierOrIndex];
index 7f3d77f..02fd591 100644 (file)
@@ -215,7 +215,7 @@ WebInspector.Sidebar = class Sidebar extends WebInspector.Object
         var sidebarPanel = null;
 
         if (sidebarPanelOrIdentifierOrIndex instanceof WebInspector.SidebarPanel) {
-            if (this._sidebarPanels.contains(sidebarPanelOrIdentifierOrIndex))
+            if (this._sidebarPanels.includes(sidebarPanelOrIdentifierOrIndex))
                 sidebarPanel = sidebarPanelOrIdentifierOrIndex;
         } else if (typeof sidebarPanelOrIdentifierOrIndex === "number") {
             sidebarPanel = this._sidebarPanels[sidebarPanelOrIdentifierOrIndex];