Bug 1271048 - Fix eslint issues in devtools/bootstrap.js. r=pbro
authorTim Nguyen <ntim.bugs@gmail.com>
Tue, 10 May 2016 00:15:03 +0200
changeset 335613 687f1eb881d82a76ddc02e71c1778c82de125407
parent 335612 83823a99114c095f1771d9a6b9c7d735dfe25abe
child 335614 a653384e97ebbb5ffbdee8b518283dc3f6d106d5
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1271048
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1271048 - Fix eslint issues in devtools/bootstrap.js. r=pbro MozReview-Commit-ID: J5BXwB4dXhD
.eslintignore
devtools/bootstrap.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -71,17 +71,16 @@ browser/components/translation/**
 browser/extensions/pdfjs/**
 browser/extensions/pocket/content/panels/js/vendor/**
 browser/locales/**
 
 # Ignore all of loop since it is imported from github and checked at source.
 browser/extensions/loop/**
 
 # devtools/ exclusions
-devtools/*.js
 devtools/client/canvasdebugger/**
 devtools/client/commandline/**
 devtools/client/debugger/**
 devtools/client/eyedropper/**
 devtools/client/framework/**
 # devtools/client/inspector/shared/*.js files are eslint-clean, so they aren't
 # included in the ignore list.
 devtools/client/inspector/computed/**
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -1,21 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+/* global content */
+/* exported startup, shutdown, install, uninstall */
+
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 function actionOccurred(id) {
   let {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
-  let Telemetry = require("devtools/client/shared/telemetry");;
+  let Telemetry = require("devtools/client/shared/telemetry");
   let telemetry = new Telemetry();
   telemetry.actionOccurred(id);
 }
 
 // Helper to listen to a key on all windows
 function MultiWindowKeyListener({ keyCode, ctrlKey, altKey, callback }) {
   let keyListener = function (event) {
     if (event.ctrlKey == !!ctrlKey &&
@@ -54,31 +57,31 @@ function MultiWindowKeyListener({ keyCod
       Services.ww.unregisterNotification(observer);
       let e = Services.ww.getWindowEnumerator();
       while (e.hasMoreElements()) {
         let window = e.getNext();
         observer(window, "domwindowclosed", null);
       }
     }
   };
-};
+}
 
 let getTopLevelWindow = function (window) {
   return window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIWebNavigation)
                .QueryInterface(Ci.nsIDocShellTreeItem)
                .rootTreeItem
                .QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIDOMWindow);
 };
 
 function reload(event) {
   // We automatically reload the toolbox if we are on a browser tab
   // with a toolbox already opened
-  let top = getTopLevelWindow(event.view)
+  let top = getTopLevelWindow(event.view);
   let isBrowser = top.location.href.includes("/browser.xul");
   let reloadToolbox = false;
   if (isBrowser && top.gBrowser) {
     // We do not use any devtools code before the call to Loader.jsm reload as
     // any attempt to use Loader.jsm to load a module will instanciate a new
     // Loader.
     let nbox = top.gBrowser.getNotificationBox();
     reloadToolbox =
@@ -90,22 +93,23 @@ function reload(event) {
   }
   let browserConsole = Services.wm.getMostRecentWindow("devtools:webconsole");
   let reopenBrowserConsole = false;
   if (browserConsole) {
     browserConsole.close();
     reopenBrowserConsole = true;
   }
 
-  dump("Reload DevTools.  (reload-toolbox:"+reloadToolbox+")\n");
+  dump("Reload DevTools.  (reload-toolbox:" + reloadToolbox + ")\n");
 
   // Invalidate xul cache in order to see changes made to chrome:// files
   Services.obs.notifyObservers(null, "startupcache-invalidate", null);
 
-  // This frame script is going to be executed in all processes: parent and childs
+  // This frame script is going to be executed in all processes:
+  // parent and child
   Services.ppmm.loadProcessScript("data:,new " + function () {
     /* Flush message manager cached frame scripts as well as chrome locales */
     let obs = Components.classes["@mozilla.org/observer-service;1"]
                         .getService(Components.interfaces.nsIObserverService);
     obs.notifyObservers(null, "message-manager-flush-caches", null);
 
     /* Also purge cached modules in child processes, we do it a few lines after
        in the parent process */
@@ -136,30 +140,31 @@ function reload(event) {
         let mm = browser.messageManager;
         // To reload JSON-View tabs and any devtools document
         if (location.startsWith("about:debugging") ||
             location.startsWith("chrome://devtools/")) {
           browser.reload();
         }
         // We have to use a frame script to query "baseURI"
         mm.loadFrameScript("data:text/javascript,new " + function () {
-          let isJSONView = content.document.baseURI.startsWith("resource://devtools/");
+          let isJSONView =
+            content.document.baseURI.startsWith("resource://devtools/");
           if (isJSONView) {
             content.location.reload();
           }
         }, false);
       }
     } else if (windowtype === "devtools:webide") {
       window.location.reload();
     }
   }
 
   if (reloadToolbox) {
-    // Reopen the toolbox automatically if we are reloading from toolbox shortcut
-    // and are on a browser window.
+    // Reopen the toolbox automatically if we are reloading from toolbox
+    // shortcut and are on a browser window.
     // Wait for a second before opening the toolbox to avoid races
     // between the old and the new one.
     let {setTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
     setTimeout(() => {
       let { TargetFactory } = devtools.require("devtools/client/framework/target");
       let { gDevTools } = devtools.require("devtools/client/framework/devtools");
       let target = TargetFactory.forTab(top.gBrowser.selectedTab);
       gDevTools.showToolbox(target);