Bug 1256767 - Fix ESLint errors/warnings in devtools/client/webconsole/console-commands.js; r=linclark
authorgasolin <gasolin@gmail.com>
Wed, 20 Apr 2016 18:06:01 +0800
changeset 299353 fb00a4b41a9f73db66848423ac837c06e28f08f6
parent 299352 cbeef9c81af6e15cd83bc648fa3c7f6f79f83c0a
child 299354 f03b60a446f193327a21e0e2ca9892538b44b2f9
push id19432
push usercbook@mozilla.com
push dateMon, 30 May 2016 10:29:23 +0000
treeherderfx-team@f03b60a446f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslinclark
bugs1256767
milestone49.0a1
Bug 1256767 - Fix ESLint errors/warnings in devtools/client/webconsole/console-commands.js; r=linclark MozReview-Commit-ID: A5L5DqtHjGe
.eslintignore
devtools/client/webconsole/console-commands.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -100,16 +100,17 @@ devtools/client/shared/components/test/*
 devtools/client/shared/redux/middleware/test/**
 devtools/client/shared/test/**
 devtools/client/shared/widgets/*.jsm
 devtools/client/sourceeditor/**
 devtools/client/webaudioeditor/**
 devtools/client/webconsole/**
 !devtools/client/webconsole/panel.js
 !devtools/client/webconsole/jsterm.js
+!devtools/client/webconsole/console-commands.js
 devtools/client/webide/**
 devtools/server/**
 !devtools/server/actors/webbrowser.js
 !devtools/server/actors/styles.js
 devtools/shared/*.js
 !devtools/shared/css-lexer.js
 !devtools/shared/promise_defer.js
 !devtools/shared/task.js
--- a/devtools/client/webconsole/console-commands.js
+++ b/devtools/client/webconsole/console-commands.js
@@ -41,64 +41,63 @@ exports.items = [
         });
       }
     },
     exec: function (args, context) {
       let target = context.environment.target;
       let toolbox = gDevTools.getToolbox(target);
 
       if (!toolbox) {
-        return gDevTools.showToolbox(target, "inspector").then((toolbox) => {
-          toolbox.toggleSplitConsole();
+        return gDevTools.showToolbox(target, "inspector").then((newToolbox) => {
+          newToolbox.toggleSplitConsole();
         });
-      } else {
-        toolbox.toggleSplitConsole();
       }
+      return toolbox.toggleSplitConsole();
     }
   },
   {
     name: "console",
     description: l10n.lookup("consoleDesc"),
     manual: l10n.lookup("consoleManual")
   },
   {
     item: "command",
     runAt: "client",
     name: "console clear",
     description: l10n.lookup("consoleclearDesc"),
     exec: function (args, context) {
       let toolbox = gDevTools.getToolbox(context.environment.target);
       if (toolbox == null) {
-        return;
+        return null;
       }
 
       let panel = toolbox.getPanel("webconsole");
       if (panel == null) {
-        return;
+        return null;
       }
 
       let onceMessagesCleared = panel.hud.jsterm.once("messages-cleared");
       panel.hud.jsterm.clearOutput();
       return onceMessagesCleared;
     }
   },
   {
     item: "command",
     runAt: "client",
     name: "console close",
     description: l10n.lookup("consolecloseDesc"),
     exec: function (args, context) {
-      return gDevTools.closeToolbox(context.environment.target)
-                      .then(() => {}); // Don't return a value to GCLI
+      // Don't return a value to GCLI
+      return gDevTools.closeToolbox(context.environment.target).then(() => {});
     }
   },
   {
     item: "command",
     runAt: "client",
     name: "console open",
     description: l10n.lookup("consoleopenDesc"),
     exec: function (args, context) {
       const target = context.environment.target;
-      return gDevTools.showToolbox(target, "webconsole")
-                      .then(() => {}); // Don't return a value to GCLI
+      // Don't return a value to GCLI
+      return gDevTools.showToolbox(target, "webconsole").then(() => {});
     }
   }
 ];