Web Inspector: Address some ESLint warnings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2017 15:59:52 +0000 (15:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2017 15:59:52 +0000 (15:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167634

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-31
Reviewed by Brian Burg.

* UserInterface/Base/DOMUtilities.js:
(WebInspector.linkifyNodeReference):
(isSimiliarNode):
(WebInspector.xpathIndex):
These empty statements were supposed to be returns!

* UserInterface/Base/Main.js:
* UserInterface/Models/CSSProperty.js:
(WebInspector.CSSProperty.prototype.get relatedLonghandProperties):
* UserInterface/Models/DOMNode.js:
* UserInterface/Protocol/Connection.js:
(InspectorBackend.Connection):
(InspectorBackend.MainConnection):
(InspectorBackend.WorkerConnection):
* UserInterface/Protocol/MainTarget.js:
(WebInspector.MainTarget):
* UserInterface/Protocol/WorkerTarget.js:
(WebInspector.WorkerTarget):
* UserInterface/Test/Test.js:
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
* UserInterface/Views/ConsoleSession.js:
(WebInspector.ConsoleSession):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel):
* UserInterface/Views/ScriptContentView.js:
(WebInspector.ScriptContentView.prototype._toggleTypeAnnotations):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._createControlFlowScrollEventHandler):
* UserInterface/Views/TextResourceContentView.js:
(WebInspector.TextResourceContentView.prototype._toggleTypeAnnotations):
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
Address pedantic warnings for consistent style.

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

18 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Source/WebInspectorUI/UserInterface/Protocol/Connection.js
Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js
Source/WebInspectorUI/UserInterface/Protocol/WorkerTarget.js
Source/WebInspectorUI/UserInterface/Test/Test.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
Source/WebInspectorUI/UserInterface/Views/ConsoleSession.js
Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js

index 8a04f0b..2b25d4c 100644 (file)
@@ -1,3 +1,49 @@
+2017-01-31  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Address some ESLint warnings
+        https://bugs.webkit.org/show_bug.cgi?id=167634
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/DOMUtilities.js:
+        (WebInspector.linkifyNodeReference):
+        (isSimiliarNode):
+        (WebInspector.xpathIndex):
+        These empty statements were supposed to be returns!
+
+        * UserInterface/Base/Main.js:
+        * UserInterface/Models/CSSProperty.js:
+        (WebInspector.CSSProperty.prototype.get relatedLonghandProperties):
+        * UserInterface/Models/DOMNode.js:
+        * UserInterface/Protocol/Connection.js:
+        (InspectorBackend.Connection):
+        (InspectorBackend.MainConnection):
+        (InspectorBackend.WorkerConnection):
+        * UserInterface/Protocol/MainTarget.js:
+        (WebInspector.MainTarget):
+        * UserInterface/Protocol/WorkerTarget.js:
+        (WebInspector.WorkerTarget):
+        * UserInterface/Test/Test.js:
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+        * UserInterface/Views/ConsoleSession.js:
+        (WebInspector.ConsoleSession):
+        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
+        (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
+        (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
+        * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+        (WebInspector.ScopeChainDetailsSidebarPanel):
+        * UserInterface/Views/ScriptContentView.js:
+        (WebInspector.ScriptContentView.prototype._toggleTypeAnnotations):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype._createControlFlowScrollEventHandler):
+        * UserInterface/Views/TextResourceContentView.js:
+        (WebInspector.TextResourceContentView.prototype._toggleTypeAnnotations):
+        * UserInterface/Workers/Formatter/EsprimaFormatter.js:
+        (EsprimaFormatter.prototype._handleTokenAtNode):
+        Address pedantic warnings for consistent style.
+
 2017-01-30  Devin Rousso  <dcrousso+webkit@gmail.com>
 
         Web Inspector: "bouncy highlight" element in TextEditor/DOMTreeOutline should update or dismiss when user scrolls
index b2a2ca1..ba423aa 100644 (file)
@@ -66,9 +66,9 @@ WebInspector.linkifyNodeReference = function(node, maxLength)
     let link = document.createElement("span");
     link.append(displayName);
     link.setAttribute("role", "link");
-    
+
     link.title = displayName;
-    
+
     let nodeType = node.nodeType();
     if ((nodeType !== Node.DOCUMENT_NODE || node.parentNode) && nodeType !== Node.TEXT_NODE)
         link.className = "node-link";
@@ -239,7 +239,7 @@ WebInspector.xpathComponent = function(node)
         break;
     case Node.PROCESSING_INSTRUCTION_NODE:
         value = "processing-instruction()";
-        break
+        break;
     default:
         value = "";
         break;
@@ -278,9 +278,9 @@ WebInspector.xpathIndex = function(node)
 
         // XPath CDATA and text() are the same.
         if (aType === Node.CDATA_SECTION_NODE)
-            aType === Node.TEXT_NODE;
+            return aType === Node.TEXT_NODE;
         if (bType === Node.CDATA_SECTION_NODE)
-            bType === Node.TEXT_NODE;
+            return bType === Node.TEXT_NODE;
 
         return aType === bType;
     }
index 540082f..7c58439 100644 (file)
@@ -2588,7 +2588,7 @@ Object.defineProperty(WebInspector, "targets",
 WebInspector.assumingMainTarget = function()
 {
     return WebInspector.mainTarget;
-}
+};
 
 // OpenResourceDialog delegate
 
index fef98ea..860f1ef 100644 (file)
@@ -230,7 +230,7 @@ WebInspector.CSSProperty = class CSSProperty extends WebInspector.Object
         this._relatedShorthandProperty = property || null;
     }
 
-    get relatedLonghandProperties() { return this._relatedLonghandProperties;}
+    get relatedLonghandProperties() { return this._relatedLonghandProperties; }
 
     addRelatedLonghandProperty(property)
     {
index 4e6f2cd..636a758 100644 (file)
@@ -824,7 +824,7 @@ WebInspector.DOMNode.ShadowRootType = {
     Closed: "closed",
     Open: "open",
 };
-                     
+
 WebInspector.DOMNode.CustomElementState = {
     Builtin: "builtin",
     Custom: "custom",
index 7232fd1..df059c1 100644 (file)
@@ -270,7 +270,7 @@ InspectorBackend.Connection = class InspectorBackendConnection
         for (let script of scriptsToRun)
             script.call(this);
     }
-}
+};
 
 InspectorBackend.MainConnection = class InspectorBackendPageConnection extends InspectorBackend.Connection
 {
@@ -285,7 +285,7 @@ InspectorBackend.MainConnection = class InspectorBackendPageConnection extends I
     {
         InspectorFrontendHost.sendMessageToBackend(message);
     }
-}
+};
 
 InspectorBackend.WorkerConnection = class InspectorBackendWorkerConnection extends InspectorBackend.Connection
 {
@@ -310,6 +310,6 @@ InspectorBackend.WorkerConnection = class InspectorBackendWorkerConnection exten
     {
         WorkerAgent.sendMessageToWorker(this._workerId, message);
     }
-}
+};
 
 InspectorBackend.mainConnection = new InspectorBackend.MainConnection;
index 9b1ccb5..9dc969f 100644 (file)
@@ -53,4 +53,4 @@ WebInspector.MainTarget = class MainTarget extends WebInspector.Target
         let mainFrame = WebInspector.frameResourceManager.mainFrame;
         return mainFrame ? mainFrame.mainResource : null;
     }
-}
+};
index 4b97f92..fbafb8c 100644 (file)
@@ -56,4 +56,4 @@ WebInspector.WorkerTarget = class WorkerTarget extends WebInspector.Target
     {
         return WebInspector.displayNameForURL(this._name);
     }
-}
+};
index a27023d..f59bf73 100644 (file)
@@ -114,7 +114,7 @@ window.InspectorTest = new FrontendTestHarness();
 
 InspectorTest.redirectConsoleToTestOutput();
 
-WebInspector.reportInternalError = (e) => { console.error(e); }
+WebInspector.reportInternalError = (e) => { console.error(e); };
 
 window.reportUnhandledRejection = InspectorTest.reportUnhandledRejection.bind(InspectorTest);
 window.onerror = InspectorTest.reportUncaughtExceptionFromEvent.bind(InspectorTest);
index 255894a..63710b1 100644 (file)
@@ -1377,7 +1377,7 @@ WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor
     _inlineSwatchDeactivated()
     {
         this._hasActiveInlineSwatchEditor = false;
-    }    
+    }
 
     _propertyOverriddenStatusChanged(event)
     {
index a6198f2..6fd4fcd 100644 (file)
@@ -43,7 +43,7 @@ WebInspector.ConsoleSession = class ConsoleSession extends WebInspector.Object
         let headerText = "";
         switch (data.newSessionReason) {
         case WebInspector.ConsoleSession.NewSessionReason.PageReloaded:
-            headerText =  WebInspector.UIString("Page reloaded at %s");
+            headerText = WebInspector.UIString("Page reloaded at %s");
             break;
         case WebInspector.ConsoleSession.NewSessionReason.PageNavigated:
             headerText = WebInspector.UIString("Page navigated at %s");
index 8d95307..f7286f4 100644 (file)
@@ -500,8 +500,8 @@ WebInspector.DOMNodeDetailsSidebarPanel = class DOMNodeDetailsSidebarPanel exten
                 let roleType = null;
                 let buttonType = null;
                 let buttonTypePopupString = WebInspector.UIString("popup");
-                let buttonTypeToggleString = WebInspector.UIString("toggle")
-                let buttonTypePopupToggleString = WebInspector.UIString("popup, toggle")
+                let buttonTypeToggleString = WebInspector.UIString("toggle");
+                let buttonTypePopupToggleString = WebInspector.UIString("popup, toggle");
 
                 if (role === "" || role === "unknown")
                     role = WebInspector.UIString("No exact ARIA role match.");
index f4cb361..a5be3c8 100644 (file)
@@ -289,7 +289,7 @@ WebInspector.ResourceSidebarPanel = class ResourceSidebarPanel extends WebInspec
         // Worker script.
         if (script.target !== WebInspector.mainTarget) {
             if (script.isMainResource())
-                this._addTargetWithMainResource(script.target)
+                this._addTargetWithMainResource(script.target);
             return;
         }
 
index 9873fd7..7da0685 100644 (file)
@@ -64,7 +64,7 @@ WebInspector.ScopeChainDetailsSidebarPanel = class ScopeChainDetailsSidebarPanel
         WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.DidEvaluate, this._didEvaluateExpression, this);
 
         // Update watch expressions when console execution context changes.
-        WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.ActiveExecutionContextChanged, this._activeExecutionContextChanged, this)
+        WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.ActiveExecutionContextChanged, this._activeExecutionContextChanged, this);
 
         // Update watch expressions on navigations.
         WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
index a106ae3..82c43ab 100644 (file)
@@ -234,7 +234,7 @@ WebInspector.ScriptContentView = class ScriptContentView extends WebInspector.Co
         this._showTypesButtonNavigationItem.enabled = false;
         this._textEditor.toggleTypeAnnotations().then(() => {
             this._showTypesButtonNavigationItem.enabled = true;
-        })
+        });
     }
 
     _toggleUnexecutedCodeHighlights(event)
index e4edda5..215bfbc 100644 (file)
@@ -2213,7 +2213,7 @@ WebInspector.SourceCodeTextEditor = class SourceCodeTextEditor extends WebInspec
             else if (this._basicBlockAnnotator)
                 this._basicBlockAnnotator.pause();
 
-            timeoutIdentifier = setTimeout(()  => {
+            timeoutIdentifier = setTimeout(() => {
                 timeoutIdentifier = null;
                 if (this._basicBlockAnnotator)
                     this._basicBlockAnnotator.resume();
index b5e8a67..267a8e4 100644 (file)
@@ -222,7 +222,7 @@ WebInspector.TextResourceContentView = class TextResourceContentView extends Web
         this._showTypesButtonNavigationItem.enabled = false;
         this._textEditor.toggleTypeAnnotations().then(() => {
             this._showTypesButtonNavigationItem.enabled = true;
-        })
+        });
     }
 
     _toggleUnexecutedCodeHighlights(event)
index 4553b66..3702feb 100644 (file)
@@ -815,7 +815,7 @@ EsprimaFormatter = class EsprimaFormatter
                 builder.appendSpace();
             builder.appendToken(tokenValue, tokenOffset);
             builder.appendSpace();
-            return;            
+            return;
         }
 
         if (nodeType === "ExportAllDeclaration" || nodeType === "ExportDefaultDeclaration" || nodeType === "ImportDefaultSpecifier" || nodeType === "ImportNamespaceSpecifier") {