Bug 1322085 - Make devtools/server/actors/*.js eslint-clean. r=ntim
authorDalimil Hajek <dalimilhajek@gmail.com>
Mon, 16 Jan 2017 12:51:00 -0500
changeset 329644 2b43e179370261a0a71b59ba6ebb24260ecba0a1
parent 329643 685121de3c2c10ecce02029c0feb18ed94b1242e
child 329645 f10afdb666c50436c20e666eb7aabca63b2f01a7
push id31218
push userphilringnalda@gmail.com
push dateTue, 17 Jan 2017 05:43:13 +0000
treeherdermozilla-central@3e275d37a062 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersntim
bugs1322085
milestone53.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 1322085 - Make devtools/server/actors/*.js eslint-clean. r=ntim
.eslintignore
devtools/.eslintrc.js
devtools/server/actors/actor-registry.js
devtools/server/actors/addon.js
devtools/server/actors/addons.js
devtools/server/actors/animation.js
devtools/server/actors/breakpoint.js
devtools/server/actors/call-watcher.js
devtools/server/actors/canvas.js
devtools/server/actors/child-process.js
devtools/server/actors/childtab.js
devtools/server/actors/chrome.js
devtools/server/actors/common.js
devtools/server/actors/css-properties.js
devtools/server/actors/device.js
devtools/server/actors/director-manager.js
devtools/server/actors/director-registry.js
devtools/server/actors/environment.js
devtools/server/actors/errordocs.js
devtools/server/actors/eventlooplag.js
devtools/server/actors/frame.js
devtools/server/actors/framerate.js
devtools/server/actors/gcli.js
devtools/server/actors/heap-snapshot-file.js
devtools/server/actors/highlighters.js
devtools/server/actors/monitor.js
devtools/server/actors/performance-entries.js
devtools/server/actors/performance-recording.js
devtools/server/actors/performance.js
devtools/server/actors/preference.js
devtools/server/actors/pretty-print-worker.js
devtools/server/actors/process.js
devtools/server/actors/profiler.js
devtools/server/actors/reflow.js
devtools/server/actors/root.js
devtools/server/actors/settings.js
devtools/server/actors/source.js
devtools/server/actors/storage.js
devtools/server/actors/timeline.js
devtools/server/actors/utils/map-uri-to-addon-id.js
devtools/server/actors/utils/webconsole-listeners.js
devtools/server/actors/webaudio.js
devtools/server/actors/webgl.js
devtools/server/actors/worker.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,17 +1,17 @@
 # Always ignore node_modules.
 **/node_modules/**/*.*
 
 # Exclude expected objdirs.
 obj*/**
 
 # We ignore all these directories by default, until we get them enabled.
 # If you are enabling a directory, please add directory specific exclusions
-# below.
+# below.
 addon-sdk/**
 build/**
 caps/**
 chrome/**
 config/**
 db/**
 docshell/**
 dom/**
@@ -97,26 +97,21 @@ devtools/client/webconsole/net/**
 devtools/client/webconsole/test/**
 devtools/client/webconsole/console-output.js
 devtools/client/webconsole/hudservice.js
 devtools/client/webconsole/utils.js
 devtools/client/webconsole/webconsole-connection-proxy.js
 devtools/client/webconsole/webconsole.js
 devtools/client/webide/**
 !devtools/client/webide/components/webideCli.js
-devtools/server/actors/*.js
-!devtools/server/actors/csscoverage.js
-!devtools/server/actors/inspector.js
-!devtools/server/actors/layout.js
-!devtools/server/actors/string.js
-!devtools/server/actors/styles.js
-!devtools/server/actors/tab.js
-!devtools/server/actors/webbrowser.js
-!devtools/server/actors/webextension.js
-!devtools/server/actors/webextension-inspected-window.js
+devtools/server/actors/webconsole.js
+devtools/server/actors/object.js
+devtools/server/actors/script.js
+devtools/server/actors/styleeditor.js
+devtools/server/actors/stylesheets.js
 devtools/server/tests/browser/**
 !devtools/server/tests/browser/browser_webextension_inspected_window.js
 devtools/server/tests/mochitest/**
 devtools/server/tests/unit/**
 devtools/shared/heapsnapshot/**
 devtools/shared/transport/tests/unit/**
 devtools/shared/webconsole/test/**
 
--- a/devtools/.eslintrc.js
+++ b/devtools/.eslintrc.js
@@ -25,17 +25,17 @@ module.exports = {
     "Node": true,
     "reportError": true,
     "require": true,
     "setInterval": true,
     "setTimeout": true,
     "uneval": true,
     "URL": true,
     "WebSocket": true,
-    "XMLHttpRequest": true,
+    "XMLHttpRequest": true
   },
   "rules": {
     // These are the rules that have been configured so far to match the
     // devtools coding style.
 
     // Rules from the mozilla plugin
     "mozilla/no-aArgs": "warn",
     "mozilla/no-cpows-in-tests": "error",
--- a/devtools/server/actors/actor-registry.js
+++ b/devtools/server/actors/actor-registry.js
@@ -1,20 +1,16 @@
 /* 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/. */
 
 "use strict";
 
 const protocol = require("devtools/shared/protocol");
-const { method, custom, Arg, Option, RetVal } = protocol;
 
-const { Cu, CC, components } = require("chrome");
-const Services = require("Services");
-const { DebuggerServer } = require("devtools/server/main");
 const { registerActor, unregisterActor } = require("devtools/server/actors/utils/actor-registry-utils");
 const { actorActorSpec, actorRegistrySpec } = require("devtools/shared/specs/actor-registry");
 
 /**
  * The ActorActor gives you a handle to an actor you've dynamically
  * registered and allows you to unregister it.
  */
 const ActorActor = protocol.ActorClassWithSpec(actorActorSpec, {
--- a/devtools/server/actors/addon.js
+++ b/devtools/server/actors/addon.js
@@ -15,19 +15,19 @@ var { assert, update } = DevToolsUtils;
 
 loader.lazyRequireGetter(this, "AddonThreadActor", "devtools/server/actors/script", true);
 loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/script", true);
 loader.lazyRequireGetter(this, "mapURIToAddonID", "devtools/server/actors/utils/map-uri-to-addon-id");
 loader.lazyRequireGetter(this, "WebConsoleActor", "devtools/server/actors/webconsole", true);
 
 loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 
-function BrowserAddonActor(aConnection, aAddon) {
-  this.conn = aConnection;
-  this._addon = aAddon;
+function BrowserAddonActor(connection, addon) {
+  this.conn = connection;
+  this._addon = addon;
   this._contextPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._contextPool);
   this.threadActor = null;
   this._global = null;
 
   this._shouldAddNewGlobalAsDebuggee = this._shouldAddNewGlobalAsDebuggee.bind(this);
 
   this.makeDebugger = makeDebugger.bind(null, {
@@ -65,17 +65,17 @@ BrowserAddonActor.prototype = {
   get sources() {
     if (!this._sources) {
       assert(this.threadActor, "threadActor should exist when creating sources.");
       this._sources = new TabSources(this.threadActor, this._allowSource);
     }
     return this._sources;
   },
 
-  form: function BAA_form() {
+  form: function BAAForm() {
     assert(this.actorID, "addon should have an actorID.");
     if (!this._consoleActor) {
       this._consoleActor = new AddonConsoleActor(this._addon, this.conn, this);
       this._contextPool.addActor(this._consoleActor);
     }
 
     return {
       actor: this.actorID,
@@ -98,85 +98,86 @@ BrowserAddonActor.prototype = {
     this.conn.removeActorPool(this._contextPool);
     this._contextPool = null;
     this._consoleActor = null;
     this._addon = null;
     this._global = null;
     AddonManager.removeAddonListener(this);
   },
 
-  setOptions: function BAA_setOptions(aOptions) {
-    if ("global" in aOptions) {
-      this._global = aOptions.global;
+  setOptions: function BAASetOptions(options) {
+    if ("global" in options) {
+      this._global = options.global;
     }
   },
 
-  onInstalled: function BAA_updateAddonWrapper(aAddon) {
-    if (aAddon.id != this._addon.id) {
+  onInstalled: function BAAUpdateAddonWrapper(addon) {
+    if (addon.id != this._addon.id) {
       return;
     }
 
     // Update the AddonManager's addon object on reload/update.
-    this._addon = aAddon;
+    this._addon = addon;
   },
 
-  onDisabled: function BAA_onDisabled(aAddon) {
-    if (aAddon != this._addon) {
+  onDisabled: function BAAOnDisabled(addon) {
+    if (addon != this._addon) {
       return;
     }
 
     this._global = null;
   },
 
-  onUninstalled: function BAA_onUninstalled(aAddon) {
-    if (aAddon != this._addon) {
+  onUninstalled: function BAAOnUninstalled(addon) {
+    if (addon != this._addon) {
       return;
     }
 
     if (this.attached) {
       this.onDetach();
 
       // The BrowserAddonActor is not a TabActor and it has to send
       // "tabDetached" directly to close the devtools toolbox window.
       this.conn.send({ from: this.actorID, type: "tabDetached" });
     }
 
     this.destroy();
   },
 
-  onAttach: function BAA_onAttach() {
+  onAttach: function BAAOnAttach() {
     if (this.exited) {
       return { type: "exited" };
     }
 
     if (!this.attached) {
       this.threadActor = new AddonThreadActor(this.conn, this);
       this._contextPool.addActor(this.threadActor);
     }
 
     return { type: "tabAttached", threadActor: this.threadActor.actorID };
   },
 
-  onDetach: function BAA_onDetach() {
+  onDetach: function BAAOnDetach() {
     if (!this.attached) {
       return { error: "wrongState" };
     }
 
     this._contextPool.removeActor(this.threadActor);
 
     this.threadActor = null;
     this._sources = null;
 
     return { type: "detached" };
   },
 
-  onReload: function BAA_onReload() {
+  onReload: function BAAOnReload() {
     return this._addon.reload()
       .then(() => {
-        return {}; // send an empty response
+        // send an empty response
+        return {};
       });
   },
 
   preNest: function () {
     let e = Services.wm.getEnumerator(null);
     while (e.hasMoreElements()) {
       let win = e.getNext();
       let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor)
@@ -196,39 +197,40 @@ BrowserAddonActor.prototype = {
       windowUtils.suppressEventHandling(false);
     }
   },
 
   /**
    * Return true if the given global is associated with this addon and should be
    * added as a debuggee, false otherwise.
    */
-  _shouldAddNewGlobalAsDebuggee: function (aGlobal) {
-    const global = unwrapDebuggerObjectGlobal(aGlobal);
+  _shouldAddNewGlobalAsDebuggee: function (givenGlobal) {
+    const global = unwrapDebuggerObjectGlobal(givenGlobal);
     try {
       // This will fail for non-Sandbox objects, hence the try-catch block.
       let metadata = Cu.getSandboxMetadata(global);
       if (metadata) {
         return metadata.addonID === this.id;
       }
-    } catch (e) {}
+    } catch (e) {
+      // ignore
+    }
 
     if (global instanceof Ci.nsIDOMWindow) {
       return mapURIToAddonID(global.document.documentURIObject) == this.id;
     }
 
     // Check the global for a __URI__ property and then try to map that to an
     // add-on
-    let uridescriptor = aGlobal.getOwnPropertyDescriptor("__URI__");
+    let uridescriptor = givenGlobal.getOwnPropertyDescriptor("__URI__");
     if (uridescriptor && "value" in uridescriptor && uridescriptor.value) {
       let uri;
       try {
         uri = Services.io.newURI(uridescriptor.value);
-      }
-      catch (e) {
+      } catch (e) {
         DevToolsUtils.reportException(
           "BrowserAddonActor.prototype._shouldAddNewGlobalAsDebuggee",
           new Error("Invalid URI: " + uridescriptor.value)
         );
         return false;
       }
 
       if (mapURIToAddonID(uri) == this.id) {
@@ -239,19 +241,19 @@ BrowserAddonActor.prototype = {
     return false;
   },
 
   /**
    * Override the eligibility check for scripts and sources to make
    * sure every script and source with a URL is stored when debugging
    * add-ons.
    */
-  _allowSource: function (aSource) {
+  _allowSource: function (source) {
     // XPIProvider.jsm evals some code in every add-on's bootstrap.js. Hide it.
-    if (aSource.url === "resource://gre/modules/addons/XPIProvider.jsm") {
+    if (source.url === "resource://gre/modules/addons/XPIProvider.jsm") {
       return false;
     }
 
     return true;
   },
 
   /**
    * Yield the current set of globals associated with this addon that should be
@@ -268,27 +270,26 @@ BrowserAddonActor.prototype.requestTypes
   "reload": BrowserAddonActor.prototype.onReload
 };
 
 /**
  * The AddonConsoleActor implements capabilities needed for the add-on web
  * console feature.
  *
  * @constructor
- * @param object aAddon
+ * @param object addon
  *        The add-on that this console watches.
- * @param object aConnection
+ * @param object connection
  *        The connection to the client, DebuggerServerConnection.
- * @param object aParentActor
+ * @param object parentActor
  *        The parent BrowserAddonActor actor.
  */
-function AddonConsoleActor(aAddon, aConnection, aParentActor)
-{
-  this.addon = aAddon;
-  WebConsoleActor.call(this, aConnection, aParentActor);
+function AddonConsoleActor(addon, connection, parentActor) {
+  this.addon = addon;
+  WebConsoleActor.call(this, connection, parentActor);
 }
 
 AddonConsoleActor.prototype = Object.create(WebConsoleActor.prototype);
 
 update(AddonConsoleActor.prototype, {
   constructor: AddonConsoleActor,
 
   actorPrefix: "addonConsole",
@@ -311,27 +312,26 @@ update(AddonConsoleActor.prototype, {
   destroy() {
     WebConsoleActor.prototype.destroy.call(this);
     this.addon = null;
   },
 
   /**
    * Handler for the "startListeners" request.
    *
-   * @param object aRequest
+   * @param object request
    *        The JSON request object received from the Web Console client.
    * @return object
    *         The response object which holds the startedListeners array.
    */
-  onStartListeners: function ACA_onStartListeners(aRequest)
-  {
+  onStartListeners: function ACAOnStartListeners(request) {
     let startedListeners = [];
 
-    while (aRequest.listeners.length > 0) {
-      let listener = aRequest.listeners.shift();
+    while (request.listeners.length > 0) {
+      let listener = request.listeners.shift();
       switch (listener) {
         case "ConsoleAPI":
           if (!this.consoleAPIListener) {
             this.consoleAPIListener =
               new ConsoleAPIListener(null, this, { addonId: this.addon.id });
             this.consoleAPIListener.init();
           }
           startedListeners.push(listener);
@@ -341,10 +341,13 @@ update(AddonConsoleActor.prototype, {
     return {
       startedListeners: startedListeners,
       nativeConsoleAPI: true,
       traits: this.traits,
     };
   },
 });
 
-AddonConsoleActor.prototype.requestTypes = Object.create(WebConsoleActor.prototype.requestTypes);
-AddonConsoleActor.prototype.requestTypes.startListeners = AddonConsoleActor.prototype.onStartListeners;
+AddonConsoleActor.prototype.requestTypes = Object.create(
+  WebConsoleActor.prototype.requestTypes
+);
+AddonConsoleActor.prototype.requestTypes.startListeners =
+  AddonConsoleActor.prototype.onStartListeners;
--- a/devtools/server/actors/addons.js
+++ b/devtools/server/actors/addons.js
@@ -29,13 +29,12 @@ const AddonsActor = protocol.ActorClassW
     // TODO: once the add-on actor has been refactored to use
     // protocol.js, we could return it directly.
     // return new BrowserAddonActor(this.conn, addon);
 
     // Return a pseudo add-on object that a calling client can work
     // with. Provide a flag that the client can use to detect when it
     // gets upgraded to a real actor object.
     return { id: addon.id, actor: false };
-
   }),
 });
 
 exports.AddonsActor = AddonsActor;
--- a/devtools/server/actors/animation.js
+++ b/devtools/server/actors/animation.js
@@ -22,19 +22,18 @@
  * - WebAnimation spec:
  *   http://w3c.github.io/web-animations/
  * - WebAnimation WebIDL files:
  *   /dom/webidl/Animation*.webidl
  */
 
 const {Cu} = require("chrome");
 const promise = require("promise");
-const {Task} = require("devtools/shared/task");
 const protocol = require("devtools/shared/protocol");
-const {Actor, ActorClassWithSpec} = protocol;
+const {Actor} = protocol;
 const {animationPlayerSpec, animationsSpec} = require("devtools/shared/specs/animation");
 const events = require("sdk/event/core");
 
 // Types of animations.
 const ANIMATION_TYPES = {
   CSS_ANIMATION: "cssanimation",
   CSS_TRANSITION: "csstransition",
   SCRIPT_ANIMATION: "scriptanimation",
@@ -469,18 +468,18 @@ var AnimationPlayerActor = protocol.Acto
   }
 });
 
 exports.AnimationPlayerActor = AnimationPlayerActor;
 
 /**
  * The Animations actor lists animation players for a given node.
  */
-var AnimationsActor = exports.AnimationsActor = protocol.ActorClassWithSpec(animationsSpec, {
-  initialize: function(conn, tabActor) {
+exports.AnimationsActor = protocol.ActorClassWithSpec(animationsSpec, {
+  initialize: function (conn, tabActor) {
     Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
 
     this.onWillNavigate = this.onWillNavigate.bind(this);
     this.onNavigate = this.onNavigate.bind(this);
     this.onAnimationMutation = this.onAnimationMutation.bind(this);
 
     this.allAnimationsPaused = false;
--- a/devtools/server/actors/breakpoint.js
+++ b/devtools/server/actors/breakpoint.js
@@ -1,14 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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 assert */
+
 "use strict";
 
 const { ActorClassWithSpec } = require("devtools/shared/protocol");
 const { breakpointSpec } = require("devtools/shared/specs/breakpoint");
 
 /**
  * Set breakpoints on all the given entry points with the given
  * BreakpointActor as the handler.
@@ -106,30 +108,31 @@ let BreakpointActor = ActorClassWithSpec
         let message = "Unknown exception";
         try {
           if (completion.throw.getOwnPropertyDescriptor) {
             message = completion.throw.getOwnPropertyDescriptor("message")
                       .value;
           } else if (completion.toString) {
             message = completion.toString();
           }
-        } catch (ex) {}
+        } catch (ex) {
+          // ignore
+        }
         return {
           result: true,
           message: message
         };
       } else if (completion.yield) {
         assert(false, "Shouldn't ever get yield completions from an eval");
       } else {
-        return { result: completion.return ? true : false };
+        return { result: !!completion.return };
       }
-    } else {
-      // The evaluation was killed (possibly by the slow script dialog)
-      return { result: undefined };
     }
+    // The evaluation was killed (possibly by the slow script dialog)
+    return { result: undefined };
   },
 
   /**
    * A function that the engine calls when a breakpoint has been hit.
    *
    * @param frame Debugger.Frame
    *        The stack frame that contained the breakpoint.
    */
--- a/devtools/server/actors/call-watcher.js
+++ b/devtools/server/actors/call-watcher.js
@@ -1,20 +1,21 @@
 /* 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/. */
 "use strict";
 
-const {Cc, Ci, Cu, Cr} = require("chrome");
+/* global XPCNativeWrapper */
+
+const {Ci, Cu} = require("chrome");
 const events = require("sdk/event/core");
 const protocol = require("devtools/shared/protocol");
 const {serializeStack, parseStack} = require("toolkit/loader");
 
-const {on, once, off, emit} = events;
-const {method, Arg, Option, RetVal} = protocol;
+const {on, off, emit} = events;
 
 const { functionCallSpec, callWatcherSpec } = require("devtools/shared/specs/call-watcher");
 const { CallWatcherFront } = require("devtools/shared/fronts/call-watcher");
 
 /**
  * This actor contains information about a function call, like the function
  * type, name, stack, arguments, returned value etc.
  */
@@ -43,17 +44,21 @@ var FunctionCallActor = protocol.ActorCl
    * @param array args
    *        The called function's arguments.
    * @param any result
    *        The value returned by the function call.
    * @param boolean holdWeak
    *        Determines whether or not FunctionCallActor stores a weak reference
    *        to the underlying objects.
    */
-  initialize: function (conn, [window, global, caller, type, name, stack, timestamp, args, result], holdWeak) {
+  initialize: function (
+    conn,
+    [window, global, caller, type, name, stack, timestamp, args, result],
+    holdWeak
+  ) {
     protocol.Actor.prototype.initialize.call(this, conn);
 
     this.details = {
       global: global,
       type: type,
       name: name,
       stack: stack,
       timestamp: timestamp
@@ -71,19 +76,18 @@ var FunctionCallActor = protocol.ActorCl
       };
 
       Object.defineProperties(this.details, {
         window: { get: () => weakRefs.window.get() },
         caller: { get: () => weakRefs.caller.get() },
         args: { get: () => weakRefs.args.get() },
         result: { get: () => weakRefs.result.get() },
       });
-    }
-    // Otherwise, hold strong references to the objects.
-    else {
+    } else {
+      // Otherwise, hold strong references to the objects.
       this.details.window = window;
       this.details.caller = caller;
       this.details.args = args;
       this.details.result = result;
     }
 
     // The caller, args and results are string names for now. It would
     // certainly be nicer if they were Object actors. Make this smarter, so
@@ -221,17 +225,17 @@ var FunctionCallActor = protocol.ActorCl
     }
     return data + "";
   }
 });
 
 /**
  * This actor observes function calls on certain objects or globals.
  */
-var CallWatcherActor = exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
+exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this._onGlobalCreated = this._onGlobalCreated.bind(this);
     this._onGlobalDestroyed = this._onGlobalDestroyed.bind(this);
     this._onContentFunctionCall = this._onContentFunctionCall.bind(this);
     on(this.tabActor, "window-ready", this._onGlobalCreated);
     on(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
@@ -250,17 +254,19 @@ var CallWatcherActor = exports.CallWatch
    */
   onCall: null,
 
   /**
    * Starts waiting for the current tab actor's document global to be
    * created, in order to instrument the specified objects and become
    * aware of everything the content does with them.
    */
-  setup: function ({ tracedGlobals, tracedFunctions, startRecording, performReload, holdWeak, storeCalls }) {
+  setup: function ({
+    tracedGlobals, tracedFunctions, startRecording, performReload, holdWeak, storeCalls
+  }) {
     if (this._initialized) {
       return;
     }
     this._initialized = true;
     this._timestampEpoch = 0;
 
     this._functionCalls = [];
     this._tracedGlobals = tracedGlobals || [];
@@ -357,110 +363,117 @@ var CallWatcherActor = exports.CallWatch
     for (let name of this._tracedFunctions) {
       overrideSymbol("window", unwrappedWindow, name, callback);
     }
 
     /**
      * Instruments a method, getter or setter on the specified target object to
      * invoke a callback whenever it is called.
      */
-    function overrideSymbol(global, target, name, callback) {
+    function overrideSymbol(global, target, name, subcallback) {
       let propertyDescriptor = Object.getOwnPropertyDescriptor(target, name);
 
       if (propertyDescriptor.get || propertyDescriptor.set) {
-        overrideAccessor(global, target, name, propertyDescriptor, callback);
+        overrideAccessor(global, target, name, propertyDescriptor, subcallback);
         return;
       }
       if (propertyDescriptor.writable && typeof propertyDescriptor.value == "function") {
-        overrideFunction(global, target, name, propertyDescriptor, callback);
-        return;
+        overrideFunction(global, target, name, propertyDescriptor, subcallback);
       }
     }
 
     /**
      * Instruments a function on the specified target object.
      */
-    function overrideFunction(global, target, name, descriptor, callback) {
+    function overrideFunction(global, target, name, descriptor, subcallback) {
       // Invoking .apply on an unxrayed content function doesn't work, because
       // the arguments array is inaccessible to it. Get Xrays back.
       let originalFunc = Cu.unwaiveXrays(target[name]);
 
       Cu.exportFunction(function (...args) {
         let result;
         try {
           result = Cu.waiveXrays(originalFunc.apply(this, args));
         } catch (e) {
           throw createContentError(e, unwrappedWindow);
         }
 
         if (self._recording) {
           let type = CallWatcherFront.METHOD_FUNCTION;
           let stack = getStack(name);
           let timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
-          callback(unwrappedWindow, global, this, type, name, stack, timestamp, args, result);
+          subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
+            args, result);
         }
         return result;
       }, target, { defineAs: name });
 
       Object.defineProperty(target, name, {
         configurable: descriptor.configurable,
         enumerable: descriptor.enumerable,
         writable: true
       });
     }
 
     /**
      * Instruments a getter or setter on the specified target object.
      */
-    function overrideAccessor(global, target, name, descriptor, callback) {
+    function overrideAccessor(global, target, name, descriptor, subcallback) {
       // Invoking .apply on an unxrayed content function doesn't work, because
       // the arguments array is inaccessible to it. Get Xrays back.
       let originalGetter = Cu.unwaiveXrays(target.__lookupGetter__(name));
       let originalSetter = Cu.unwaiveXrays(target.__lookupSetter__(name));
 
       Object.defineProperty(target, name, {
         get: function (...args) {
-          if (!originalGetter) return undefined;
+          if (!originalGetter) {
+            return undefined;
+          }
           let result = Cu.waiveXrays(originalGetter.apply(this, args));
 
           if (self._recording) {
             let type = CallWatcherFront.GETTER_FUNCTION;
             let stack = getStack(name);
             let timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
-            callback(unwrappedWindow, global, this, type, name, stack, timestamp, args, result);
+            subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
+              args, result);
           }
           return result;
         },
         set: function (...args) {
-          if (!originalSetter) return;
+          if (!originalSetter) {
+            return;
+          }
           originalSetter.apply(this, args);
 
           if (self._recording) {
             let type = CallWatcherFront.SETTER_FUNCTION;
             let stack = getStack(name);
             let timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
-            callback(unwrappedWindow, global, this, type, name, stack, timestamp, args, undefined);
+            subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
+              args, undefined);
           }
         },
         configurable: descriptor.configurable,
         enumerable: descriptor.enumerable
       });
     }
 
     /**
      * Stores the relevant information about calls on the stack when
      * a function is called.
      */
     function getStack(caller) {
+      let stack;
       try {
         // Using Components.stack wouldn't be a better idea, since it's
         // much slower because it attempts to retrieve the C++ stack as well.
         throw new Error();
       } catch (e) {
-        var stack = e.stack;
+        stack = e.stack;
       }
 
       // Of course, using a simple regex like /(.*?)@(.*):(\d*):\d*/ would be
       // much prettier, but this is a very hot function, so let's sqeeze
       // every drop of performance out of it.
       let calls = [];
       let callIndex = 0;
       let currNewLinePivot = stack.indexOf("\n") + 1;
@@ -583,50 +596,53 @@ function getBitToEnumValue(type, object,
     // in `table`
     flag = flag | 0;
     if (flag && (arg & flag) === flag) {
       flags.push(table[flag]);
     }
   }
 
   // Cache the combined bitmask value
-  return table[arg] = flags.join(" | ") || arg;
+  table[arg] = flags.join(" | ") || arg;
+  return table[arg];
 }
 
 /**
  * Creates a new error from an error that originated from content but was called
  * from a wrapped overridden method. This is so we can make our own error
  * that does not look like it originated from the call watcher.
  *
  * We use toolkit/loader's parseStack and serializeStack rather than the
  * parsing done in the local `getStack` function, because it does not expose
- * column number, would have to change the protocol models `call-stack-items` and `call-details`
- * which hurts backwards compatibility, and the local `getStack` is an optimized, hot function.
+ * column number, would have to change the protocol models `call-stack-items`
+ * and `call-details` which hurts backwards compatibility, and the local `getStack`
+ * is an optimized, hot function.
  */
 function createContentError(e, win) {
   let { message, name, stack } = e;
   let parsedStack = parseStack(stack);
   let { fileName, lineNumber, columnNumber } = parsedStack[parsedStack.length - 1];
   let error;
 
   let isDOMException = e instanceof Ci.nsIDOMDOMException;
   let constructor = isDOMException ? win.DOMException : (win[e.name] || win.Error);
 
   if (isDOMException) {
     error = new constructor(message, name);
     Object.defineProperties(error, {
       code: { value: e.code },
-      columnNumber: { value: 0 }, // columnNumber is always 0 for DOMExceptions?
-      filename: { value: fileName }, // note the lowercase `filename`
+      // columnNumber is always 0 for DOMExceptions?
+      columnNumber: { value: 0 },
+      // note the lowercase `filename`
+      filename: { value: fileName },
       lineNumber: { value: lineNumber },
       result: { value: e.result },
       stack: { value: serializeStack(parsedStack) }
     });
-  }
-  else {
+  } else {
     // Constructing an error here retains all the stack information,
     // and we can add message, fileName and lineNumber via constructor, though
     // need to manually add columnNumber.
     error = new constructor(message, fileName, lineNumber);
     Object.defineProperty(error, "columnNumber", {
       value: columnNumber
     });
   }
--- a/devtools/server/actors/canvas.js
+++ b/devtools/server/actors/canvas.js
@@ -1,35 +1,29 @@
 /* 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/. */
 "use strict";
 
-const {Cc, Ci, Cu, Cr} = require("chrome");
-const events = require("sdk/event/core");
+/* global XPCNativeWrapper */
+
 const promise = require("promise");
 const protocol = require("devtools/shared/protocol");
 const {CallWatcherActor} = require("devtools/server/actors/call-watcher");
 const {CallWatcherFront} = require("devtools/shared/fronts/call-watcher");
-const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const {WebGLPrimitiveCounter} = require("devtools/server/primitive");
 const {
   frameSnapshotSpec,
   canvasSpec,
   CANVAS_CONTEXTS,
   ANIMATION_GENERATORS,
-  LOOP_GENERATORS,
-  DRAW_CALLS,
-  INTERESTING_CALLS,
+  LOOP_GENERATORS
 } = require("devtools/shared/specs/canvas");
 const {CanvasFront} = require("devtools/shared/fronts/canvas");
 
-const {on, once, off, emit} = events;
-const {method, custom, Arg, Option, RetVal} = protocol;
-
 /**
  * This actor represents a recorded animation frame snapshot, along with
  * all the corresponding canvas' context methods invoked in that frame,
  * thumbnails for each draw call and a screenshot of the end result.
  */
 var FrameSnapshotActor = protocol.ActorClassWithSpec(frameSnapshotSpec, {
   /**
    * Creates the frame snapshot call actor.
@@ -68,17 +62,16 @@ var FrameSnapshotActor = protocol.ActorC
     };
   },
 
   /**
    * Gets a screenshot of the canvas's contents after the specified
    * function was called.
    */
   generateScreenshotFor: function (functionCall) {
-    let caller = functionCall.details.caller;
     let global = functionCall.details.global;
 
     let canvas = this._contentCanvas;
     let calls = this._functionCalls;
     let index = calls.indexOf(functionCall);
 
     // To get a screenshot, replay all the steps necessary to render the frame,
     // by invoking the context calls up to and including the specified one.
@@ -86,24 +79,30 @@ var FrameSnapshotActor = protocol.ActorC
     let replayData = ContextUtils.replayAnimationFrame({
       contextType: global,
       canvas: canvas,
       calls: calls,
       first: 0,
       last: index
     });
 
-    let { replayContext, replayContextScaling, lastDrawCallIndex, doCleanup } = replayData;
+    let {
+      replayContext,
+      replayContextScaling,
+      lastDrawCallIndex,
+      doCleanup
+    } = replayData;
     let [left, top, width, height] = replayData.replayViewport;
     let screenshot;
 
     // Depending on the canvas' context, generating a screenshot is done
     // in different ways.
     if (global == "WebGLRenderingContext") {
-      screenshot = ContextUtils.getPixelsForWebGL(replayContext, left, top, width, height);
+      screenshot = ContextUtils.getPixelsForWebGL(replayContext, left, top,
+        width, height);
       screenshot.flipped = true;
     } else if (global == "CanvasRenderingContext2D") {
       screenshot = ContextUtils.getPixelsFor2D(replayContext, left, top, width, height);
       screenshot.flipped = false;
     }
 
     // In case of the WebGL context, we also need to reset the framebuffer
     // binding to the original value, after generating the screenshot.
@@ -115,17 +114,17 @@ var FrameSnapshotActor = protocol.ActorC
   }
 });
 
 /**
  * This Canvas Actor handles simple instrumentation of all the methods
  * of a 2D or WebGL context, to provide information regarding all the calls
  * made when drawing frame inside an animation loop.
  */
-var CanvasActor = exports.CanvasActor = protocol.ActorClassWithSpec(canvasSpec, {
+exports.CanvasActor = protocol.ActorClassWithSpec(canvasSpec, {
   // Reset for each recording, boolean indicating whether or not
   // any draw calls were called for a recording.
   _animationContainsDrawCall: false,
 
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this._webGLPrimitiveCounter = new WebGLPrimitiveCounter(tabActor);
@@ -185,17 +184,18 @@ var CanvasActor = exports.CanvasActor = 
    */
   isRecording: function () {
     return !!this._callWatcher.isRecording();
   },
 
   /**
    * Records a snapshot of all the calls made during the next animation frame.
    * The animation should be implemented via the de-facto requestAnimationFrame
-   * utility, or inside recursive `setTimeout`s. `setInterval` at this time are not supported.
+   * utility, or inside recursive `setTimeout`s. `setInterval` at this time are
+   * not supported.
    */
   recordAnimationFrame: function () {
     if (this._callWatcher.isRecording()) {
       return this._currentAnimationFrameSnapshot.promise;
     }
 
     this._recordingContainsDrawCall = false;
     this._callWatcher.eraseRecording();
@@ -246,31 +246,29 @@ var CanvasActor = exports.CanvasActor = 
     // used on the web, especially for old demos; it's nice to support them as well.
     if (CanvasFront.LOOP_GENERATORS.has(name)) {
       this._handleAnimationFrame(functionCall);
       return;
     }
     if (CanvasFront.DRAW_CALLS.has(name) && this._animationStarted) {
       this._handleDrawCall(functionCall);
       this._webGLPrimitiveCounter.handleDrawPrimitive(functionCall);
-      return;
     }
   },
 
   /**
    * Handle animations generated using requestAnimationFrame.
    */
   _handleAnimationFrame: function (functionCall) {
     if (!this._animationStarted) {
       this._handleAnimationFrameBegin();
-    }
-    // Check to see if draw calls occurred yet, as it could be future frames,
-    // like in the scenario where requestAnimationFrame is called to trigger an animation,
-    // and rAF is at the beginning of the animate loop.
-    else if (this._animationContainsDrawCall) {
+    } else if (this._animationContainsDrawCall) {
+      // Check to see if draw calls occurred yet, as it could be future frames,
+      // like in the scenario where requestAnimationFrame is called to trigger
+      // an animation, and rAF is at the beginning of the animate loop.
       this._handleAnimationFrameEnd(functionCall);
     }
   },
 
   /**
    * Called whenever an animation frame rendering begins.
    */
   _handleAnimationFrameBegin: function () {
@@ -289,17 +287,18 @@ var CanvasActor = exports.CanvasActor = 
     this._callWatcher.eraseRecording();
     this._animationContainsDrawCall = false;
 
     // Since the animation frame finished, get a hold of the (already retrieved)
     // canvas pixels to conveniently create a screenshot of the final rendering.
     let index = this._lastDrawCallIndex;
     let width = this._lastContentCanvasWidth;
     let height = this._lastContentCanvasHeight;
-    let flipped = !!this._lastThumbnailFlipped; // undefined -> false
+    // undefined -> false
+    let flipped = !!this._lastThumbnailFlipped;
     let pixels = ContextUtils.getPixelStorage()["8bit"];
     let primitiveResult = this._webGLPrimitiveCounter.getCounts();
     let animationFrameEndScreenshot = {
       index: index,
       width: width,
       height: height,
       scaling: 1,
       flipped: flipped,
@@ -404,18 +403,18 @@ var ContextUtils = {
    * @return object
    *         An objet containing the screenshot's width, height and pixel data,
    *         represented as an 8-bit array buffer of r, g, b, a values.
    */
   getPixelsForWebGL: function (gl,
     srcX = 0, srcY = 0,
     srcWidth = gl.canvas.width,
     srcHeight = gl.canvas.height,
-    dstHeight = srcHeight)
-  {
+    dstHeight = srcHeight
+  ) {
     let contentPixels = ContextUtils.getPixelStorage(srcWidth, srcHeight);
     let { "8bit": charView, "32bit": intView } = contentPixels;
     gl.readPixels(srcX, srcY, srcWidth, srcHeight, gl.RGBA, gl.UNSIGNED_BYTE, charView);
     return this.resizePixels(intView, srcWidth, srcHeight, dstHeight);
   },
 
   /**
    * Gets a hold of the rendered pixels in the most efficient way possible for
@@ -436,18 +435,18 @@ var ContextUtils = {
    * @return object
    *         An objet containing the screenshot's width, height and pixel data,
    *         represented as an 8-bit array buffer of r, g, b, a values.
    */
   getPixelsFor2D: function (ctx,
     srcX = 0, srcY = 0,
     srcWidth = ctx.canvas.width,
     srcHeight = ctx.canvas.height,
-    dstHeight = srcHeight)
-  {
+    dstHeight = srcHeight
+  ) {
     let { data } = ctx.getImageData(srcX, srcY, srcWidth, srcHeight);
     let { "32bit": intView } = ContextUtils.usePixelStorage(data.buffer);
     return this.resizePixels(intView, srcWidth, srcHeight, dstHeight);
   },
 
   /**
    * Resizes the provided pixels to fit inside a rectangle with the specified
    * height and the same aspect ratio as the source.
@@ -559,19 +558,18 @@ var ContextUtils = {
       let { newViewport, oldViewport } = this.setCustomViewport(gl, w, h);
       customViewport = newViewport;
 
       // Revert the framebuffer and viewport to the original values.
       doCleanup = () => {
         gl.bindFramebuffer(gl.FRAMEBUFFER, oldFramebuffer);
         gl.viewport.apply(gl, oldViewport);
       };
-    }
-    // In case of 2D contexts, draw everything on a separate canvas context.
-    else if (contextType == "CanvasRenderingContext2D") {
+    } else if (contextType == "CanvasRenderingContext2D") {
+      // In case of 2D contexts, draw everything on a separate canvas context.
       let contentDocument = canvas.ownerDocument;
       let replayCanvas = contentDocument.createElement("canvas");
       replayCanvas.width = w;
       replayCanvas.height = h;
       replayContext = replayCanvas.getContext("2d");
       replayContextScaling = 1;
       customViewport = [0, 0, w, h];
     }
@@ -584,17 +582,18 @@ var ContextUtils = {
       // to the default value, since we want to perform the rendering offscreen.
       if (name == "bindFramebuffer" && args[1] == null) {
         replayContext.bindFramebuffer(replayContext.FRAMEBUFFER, customFramebuffer);
         continue;
       }
       // Also prevent WebGL context calls that try to change the viewport
       // while our custom framebuffer is bound.
       if (name == "viewport") {
-        let framebufferBinding = replayContext.getParameter(replayContext.FRAMEBUFFER_BINDING);
+        let framebufferBinding = replayContext.getParameter(
+          replayContext.FRAMEBUFFER_BINDING);
         if (framebufferBinding == customFramebuffer) {
           replayContext.viewport.apply(replayContext, customViewport);
           continue;
         }
       }
       if (type == CallWatcherFront.METHOD_FUNCTION) {
         replayContext[name].apply(replayContext, args);
       } else if (type == CallWatcherFront.SETTER_FUNCTION) {
@@ -640,20 +639,21 @@ var ContextUtils = {
    * Creates and saves the array buffer views used by `getPixelStorage`.
    *
    * @param ArrayBuffer buffer
    *        The raw buffer used as storage for various array buffer views.
    */
   usePixelStorage: function (buffer) {
     let array8bit = new Uint8Array(buffer);
     let array32bit = new Uint32Array(buffer);
-    return this._currentPixelStorage = {
+    this._currentPixelStorage = {
       "8bit": array8bit,
       "32bit": array32bit
     };
+    return this._currentPixelStorage;
   },
 
   /**
    * Creates a framebuffer of the specified dimensions for a WebGL context,
    * assuming a RGBA color buffer, a depth buffer and no stencil buffer.
    *
    * @param WebGLRenderingContext gl
    *        The WebGL context to create and bind a framebuffer for.
@@ -675,24 +675,27 @@ var ContextUtils = {
     // Use a texture as the color renderbuffer attachment, since consumers of
     // this function will most likely want to read the rendered pixels back.
     let colorBuffer = gl.createTexture();
     gl.bindTexture(gl.TEXTURE_2D, colorBuffer);
     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA,
+      gl.UNSIGNED_BYTE, null);
 
     let depthBuffer = gl.createRenderbuffer();
     gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
     gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
 
-    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorBuffer, 0);
-    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer);
+    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D,
+      colorBuffer, 0);
+    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER,
+      depthBuffer);
 
     gl.bindTexture(gl.TEXTURE_2D, oldTextureBinding);
     gl.bindRenderbuffer(gl.RENDERBUFFER, oldRenderbufferBinding);
 
     return { oldFramebuffer, newFramebuffer };
   },
 
   /**
--- a/devtools/server/actors/child-process.js
+++ b/devtools/server/actors/child-process.js
@@ -5,24 +5,23 @@
 "use strict";
 
 const { Cc, Ci, Cu } = require("chrome");
 
 const { ChromeDebuggerActor } = require("devtools/server/actors/script");
 const { WebConsoleActor } = require("devtools/server/actors/webconsole");
 const makeDebugger = require("devtools/server/actors/utils/make-debugger");
 const { ActorPool } = require("devtools/server/main");
-const Services = require("Services");
 const { assert } = require("devtools/shared/DevToolsUtils");
 const { TabSources } = require("./utils/TabSources");
 
 loader.lazyRequireGetter(this, "WorkerActorList", "devtools/server/actors/worker-list", true);
 
-function ChildProcessActor(aConnection) {
-  this.conn = aConnection;
+function ChildProcessActor(connection) {
+  this.conn = connection;
   this._contextPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._contextPool);
   this.threadActor = null;
 
   // Use a see-everything debugger
   this.makeDebugger = makeDebugger.bind(null, {
     findDebuggees: dbg => dbg.findAllGlobals(),
     shouldAddNewGlobalAsDebuggee: global => true
--- a/devtools/server/actors/childtab.js
+++ b/devtools/server/actors/childtab.js
@@ -21,18 +21,17 @@ var { TabActor } = require("devtools/ser
  * @param connection DebuggerServerConnection
  *        The conection to the client.
  * @param chromeGlobal
  *        The content script global holding |content| and |docShell| properties for a tab.
  * @param prefix
  *        the prefix used in protocol to create IDs for each actor.
  *        Used as ID identifying this particular TabActor from the parent process.
  */
-function ContentActor(connection, chromeGlobal, prefix)
-{
+function ContentActor(connection, chromeGlobal, prefix) {
   this._chromeGlobal = chromeGlobal;
   this._prefix = prefix;
   TabActor.call(this, connection, chromeGlobal);
   this.traits.reconfigure = false;
   this._sendForm = this._sendForm.bind(this);
   this._chromeGlobal.addMessageListener("debug:form", this._sendForm);
 
   Object.defineProperty(this, "docShell", {
--- a/devtools/server/actors/chrome.js
+++ b/devtools/server/actors/chrome.js
@@ -22,21 +22,21 @@ const makeDebugger = require("./utils/ma
  * so that the root actor was also exposing tab actors for the main process.
  * Tab actors ended up having RootActor as parent actor,
  * but more and more features of the tab actors were relying on TabActor.
  * So we are now exposing a process actor that offers the same API as TabActor
  * by inheriting its functionality.
  * Global actors are now only the actors that are meant to be global,
  * and are no longer related to any specific scope/document.
  *
- * @param aConnection DebuggerServerConnection
+ * @param connection DebuggerServerConnection
  *        The connection to the client.
  */
-function ChromeActor(aConnection) {
-  TabActor.call(this, aConnection);
+function ChromeActor(connection) {
+  TabActor.call(this, connection);
 
   // This creates a Debugger instance for chrome debugging all globals.
   this.makeDebugger = makeDebugger.bind(null, {
     findDebuggees: dbg => dbg.findAllGlobals(),
     shouldAddNewGlobalAsDebuggee: () => true
   });
 
   // Ensure catching the creation of any new content docshell
@@ -83,78 +83,78 @@ Object.defineProperty(ChromeActor.protot
                            .QueryInterface(Ci.nsIDocShell);
       docShells = docShells.concat(getChildDocShells(docShell));
     }
 
     return docShells;
   }
 });
 
-ChromeActor.prototype.observe = function (aSubject, aTopic, aData) {
-  TabActor.prototype.observe.call(this, aSubject, aTopic, aData);
+ChromeActor.prototype.observe = function (subject, topic, data) {
+  TabActor.prototype.observe.call(this, subject, topic, data);
   if (!this.attached) {
     return;
   }
-  if (aTopic == "chrome-webnavigation-create") {
-    aSubject.QueryInterface(Ci.nsIDocShell);
-    this._onDocShellCreated(aSubject);
-  } else if (aTopic == "chrome-webnavigation-destroy") {
-    this._onDocShellDestroy(aSubject);
+  if (topic == "chrome-webnavigation-create") {
+    subject.QueryInterface(Ci.nsIDocShell);
+    this._onDocShellCreated(subject);
+  } else if (topic == "chrome-webnavigation-destroy") {
+    this._onDocShellDestroy(subject);
   }
 };
 
 ChromeActor.prototype._attach = function () {
   if (this.attached) {
     return false;
   }
 
   TabActor.prototype._attach.call(this);
 
   // Listen for any new/destroyed chrome docshell
   Services.obs.addObserver(this, "chrome-webnavigation-create", false);
   Services.obs.addObserver(this, "chrome-webnavigation-destroy", false);
 
   // Iterate over all top-level windows.
-  let docShells = [];
   let e = Services.ww.getWindowEnumerator();
   while (e.hasMoreElements()) {
     let window = e.getNext();
     let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShell);
     if (docShell == this.docShell) {
       continue;
     }
     this._progressListener.watch(docShell);
   }
+  return undefined;
 };
 
 ChromeActor.prototype._detach = function () {
   if (!this.attached) {
     return false;
   }
 
   Services.obs.removeObserver(this, "chrome-webnavigation-create");
   Services.obs.removeObserver(this, "chrome-webnavigation-destroy");
 
   // Iterate over all top-level windows.
-  let docShells = [];
   let e = Services.ww.getWindowEnumerator();
   while (e.hasMoreElements()) {
     let window = e.getNext();
     let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShell);
     if (docShell == this.docShell) {
       continue;
     }
     this._progressListener.unwatch(docShell);
   }
 
   TabActor.prototype._detach.call(this);
+  return undefined;
 };
 
 /* ThreadActor hooks. */
 
 /**
  * Prepare to enter a nested event loop by disabling debuggee events.
  */
 ChromeActor.prototype.preNest = function () {
@@ -167,17 +167,17 @@ ChromeActor.prototype.preNest = function
     windowUtils.suppressEventHandling(true);
     windowUtils.suspendTimeouts();
   }
 };
 
 /**
  * Prepare to exit a nested event loop by enabling debuggee events.
  */
-ChromeActor.prototype.postNest = function (aNestData) {
+ChromeActor.prototype.postNest = function (nestData) {
   // Enable events in all open windows.
   let e = Services.wm.getEnumerator(null);
   while (e.hasMoreElements()) {
     let win = e.getNext();
     let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIDOMWindowUtils);
     windowUtils.resumeTimeouts();
     windowUtils.suppressEventHandling(false);
--- a/devtools/server/actors/common.js
+++ b/devtools/server/actors/common.js
@@ -73,17 +73,18 @@ function RegisteredActorFactory(options,
     // For old actors, we allow the use of a different prefix for actorID
     // than for listTabs actor names, by fetching a prefix on the actor prototype.
     // (Used by ChromeDebuggerActor)
     if (options.prototype && options.prototype.actorPrefix) {
       this._prefix = options.prototype.actorPrefix;
     }
   }
 }
-RegisteredActorFactory.prototype.createObservedActorFactory = function (conn, parentActor) {
+RegisteredActorFactory.prototype.createObservedActorFactory = function (conn,
+  parentActor) {
   return new ObservedActorFactory(this._getConstructor, this._prefix, conn, parentActor);
 };
 exports.RegisteredActorFactory = RegisteredActorFactory;
 
 /**
  * Creates "observed" actors factory meant for creating real actor instances.
  * These factories lives in actor pools and fake various actor attributes.
  * They will be replaced in actor pools by final actor instances during
@@ -105,157 +106,155 @@ function ObservedActorFactory(getConstru
 
   this.actorPrefix = prefix;
 
   this.actorID = null;
   this.registeredPool = null;
 }
 ObservedActorFactory.prototype.createActor = function () {
   // Fetch the actor constructor
-  let c = this._getConstructor();
+  let C = this._getConstructor();
   // Instantiate a new actor instance
-  let instance = new c(this._conn, this._parentActor);
+  let instance = new C(this._conn, this._parentActor);
   instance.conn = this._conn;
   instance.parentID = this._parentActor.actorID;
   // We want the newly-constructed actor to completely replace the factory
   // actor. Reusing the existing actor ID will make sure ActorPool.addActor
   // does the right thing.
   instance.actorID = this.actorID;
   this.registeredPool.addActor(instance);
   return instance;
 };
 exports.ObservedActorFactory = ObservedActorFactory;
 
-
 /**
  * Methods shared between RootActor and BrowserTabActor.
  */
 
 /**
- * Populate |this._extraActors| as specified by |aFactories|, reusing whatever
+ * Populate |this._extraActors| as specified by |factories|, reusing whatever
  * actors are already there. Add all actors in the final extra actors table to
- * |aPool|.
+ * |pool|.
  *
  * The root actor and the tab actor use this to instantiate actors that other
  * parts of the browser have specified with DebuggerServer.addTabActor and
  * DebuggerServer.addGlobalActor.
  *
- * @param aFactories
+ * @param factories
  *     An object whose own property names are the names of properties to add to
  *     some reply packet (say, a tab actor grip or the "listTabs" response
  *     form), and whose own property values are actor constructor functions, as
  *     documented for addTabActor and addGlobalActor.
  *
  * @param this
  *     The BrowserRootActor or BrowserTabActor with which the new actors will
- *     be associated. It should support whatever API the |aFactories|
+ *     be associated. It should support whatever API the |factories|
  *     constructor functions might be interested in, as it is passed to them.
  *     For the sake of CommonCreateExtraActors itself, it should have at least
  *     the following properties:
  *
  *     - _extraActors
  *        An object whose own property names are factory table (and packet)
  *        property names, and whose values are no-argument actor constructors,
  *        of the sort that one can add to an ActorPool.
  *
  *     - conn
  *        The DebuggerServerConnection in which the new actors will participate.
  *
  *     - actorID
  *        The actor's name, for use as the new actors' parentID.
  */
-exports.createExtraActors = function createExtraActors(aFactories, aPool) {
+exports.createExtraActors = function createExtraActors(factories, pool) {
   // Walk over global actors added by extensions.
-  for (let name in aFactories) {
+  for (let name in factories) {
     let actor = this._extraActors[name];
     if (!actor) {
       // Register another factory, but this time specific to this connection.
       // It creates a fake actor that looks like an regular actor in the pool,
       // but without actually instantiating the actor.
       // It will only be instantiated on the first request made to the actor.
-      actor = aFactories[name].createObservedActorFactory(this.conn, this);
+      actor = factories[name].createObservedActorFactory(this.conn, this);
       this._extraActors[name] = actor;
     }
 
     // If the actor already exists in the pool, it may have been instantiated,
     // so make sure not to overwrite it by a non-instantiated version.
-    if (!aPool.has(actor.actorID)) {
-      aPool.addActor(actor);
+    if (!pool.has(actor.actorID)) {
+      pool.addActor(actor);
     }
   }
 };
 
 /**
  * Append the extra actors in |this._extraActors|, constructed by a prior call
- * to CommonCreateExtraActors, to |aObject|.
+ * to CommonCreateExtraActors, to |object|.
  *
- * @param aObject
+ * @param object
  *     The object to which the extra actors should be added, under the
- *     property names given in the |aFactories| table passed to
+ *     property names given in the |factories| table passed to
  *     CommonCreateExtraActors.
  *
  * @param this
  *     The BrowserRootActor or BrowserTabActor whose |_extraActors| table we
  *     should use; see above.
  */
-exports.appendExtraActors = function appendExtraActors(aObject) {
+exports.appendExtraActors = function appendExtraActors(object) {
   for (let name in this._extraActors) {
     let actor = this._extraActors[name];
-    aObject[name] = actor.actorID;
+    object[name] = actor.actorID;
   }
 };
 
 /**
  * Construct an ActorPool.
  *
  * ActorPools are actorID -> actor mapping and storage.  These are
  * used to accumulate and quickly dispose of groups of actors that
  * share a lifetime.
  */
-function ActorPool(aConnection)
-{
-  this.conn = aConnection;
+function ActorPool(connection) {
+  this.conn = connection;
   this._actors = {};
 }
 
 ActorPool.prototype = {
   /**
    * Destroy the pool. This will remove all actors from the pool.
    */
-  destroy: function AP_destroy() {
+  destroy: function APDestroy() {
     for (let id in this._actors) {
       this.removeActor(this._actors[id]);
     }
   },
 
   /**
    * Add an actor to the pool. If the actor doesn't have an ID, allocate one
    * from the connection.
    *
-   * @param Object aActor
+   * @param Object actor
    *        The actor to be added to the pool.
    */
-  addActor: function AP_addActor(aActor) {
-    aActor.conn = this.conn;
-    if (!aActor.actorID) {
-      let prefix = aActor.actorPrefix;
-      if (!prefix && typeof aActor == "function") {
+  addActor: function APAddActor(actor) {
+    actor.conn = this.conn;
+    if (!actor.actorID) {
+      let prefix = actor.actorPrefix;
+      if (!prefix && typeof actor == "function") {
         // typeName is a convention used with protocol.js-based actors
-        prefix = aActor.prototype.actorPrefix || aActor.prototype.typeName;
+        prefix = actor.prototype.actorPrefix || actor.prototype.typeName;
       }
-      aActor.actorID = this.conn.allocID(prefix || undefined);
+      actor.actorID = this.conn.allocID(prefix || undefined);
     }
 
     // If the actor is already in a pool, remove it without destroying it.
-    if (aActor.registeredPool) {
-      delete aActor.registeredPool._actors[aActor.actorID];
+    if (actor.registeredPool) {
+      delete actor.registeredPool._actors[actor.actorID];
     }
-    aActor.registeredPool = this;
+    actor.registeredPool = this;
 
-    this._actors[aActor.actorID] = aActor;
+    this._actors[actor.actorID] = actor;
   },
 
   /**
    * Remove an actor from the pool. If the actor has a destroy method, call it.
    */
   removeActor(actor) {
     delete this._actors[actor.actorID];
     if (actor.destroy) {
@@ -263,36 +262,36 @@ ActorPool.prototype = {
       return;
     }
     // Obsolete destruction method name (might still be used by custom actors)
     if (actor.disconnect) {
       actor.disconnect();
     }
   },
 
-  get: function AP_get(aActorID) {
-    return this._actors[aActorID] || undefined;
+  get: function APGet(actorID) {
+    return this._actors[actorID] || undefined;
   },
 
-  has: function AP_has(aActorID) {
-    return aActorID in this._actors;
+  has: function APHas(actorID) {
+    return actorID in this._actors;
   },
 
   /**
    * Returns true if the pool is empty.
    */
-  isEmpty: function AP_isEmpty() {
+  isEmpty: function APIsEmpty() {
     return Object.keys(this._actors).length == 0;
   },
 
   /**
    * Match the api expected by the protocol library.
    */
-  unmanage: function (aActor) {
-    return this.removeActor(aActor);
+  unmanage: function (actor) {
+    return this.removeActor(actor);
   },
 
   forEach: function (callback) {
     for (let name in this._actors) {
       callback(this._actors[name]);
     }
   },
 };
@@ -470,33 +469,33 @@ exports.GeneratedLocation = GeneratedLoc
  * returns a rejected promise.
  *
  * The actor's state must be at this.state property.
  *
  * @param String expectedState
  *        The expected state.
  * @param String activity
  *        Additional info about what's going on.
- * @param Function method
+ * @param Function methodFunc
  *        The actor method to proceed with when the actor is in the expected
  *        state.
  *
  * @returns Function
  *          The decorated method.
  */
-function expectState(expectedState, method, activity) {
+function expectState(expectedState, methodFunc, activity) {
   return function (...args) {
     if (this.state !== expectedState) {
       const msg = `Wrong state while ${activity}:` +
                   `Expected '${expectedState}', ` +
                   `but current state is '${this.state}'.`;
       return promise.reject(new Error(msg));
     }
 
-    return method.apply(this, args);
+    return methodFunc.apply(this, args);
   };
 }
 
 exports.expectState = expectState;
 
 /**
  * Proxies a call from an actor to an underlying module, stored
  * as `bridge` on the actor. This allows a module to be defined in one
@@ -512,14 +511,14 @@ function actorBridge(methodName, definit
   }, definition);
 }
 exports.actorBridge = actorBridge;
 
 /**
  * Like `actorBridge`, but without a spec definition, for when the actor is
  * created with `ActorClassWithSpec` rather than vanilla `ActorClass`.
  */
-function actorBridgeWithSpec (methodName) {
+function actorBridgeWithSpec(methodName) {
   return method(function () {
     return this.bridge[methodName].apply(this.bridge, arguments);
   });
 }
 exports.actorBridgeWithSpec = actorBridgeWithSpec;
--- a/devtools/server/actors/css-properties.js
+++ b/devtools/server/actors/css-properties.js
@@ -8,17 +8,17 @@ const { Cc, Ci } = require("chrome");
 
 loader.lazyGetter(this, "DOMUtils", () => {
   return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
 });
 
 const protocol = require("devtools/shared/protocol");
 const { ActorClassWithSpec, Actor } = protocol;
 const { cssPropertiesSpec } = require("devtools/shared/specs/css-properties");
-const { CSS_PROPERTIES, CSS_TYPES } = require("devtools/shared/css/properties-db");
+const { CSS_TYPES } = require("devtools/shared/css/properties-db");
 const { cssColors } = require("devtools/shared/css/color-db");
 
 exports.CssPropertiesActor = ActorClassWithSpec(cssPropertiesSpec, {
   typeName: "cssProperties",
 
   initialize(conn) {
     Actor.prototype.initialize.call(this, conn);
   },
--- a/devtools/server/actors/device.js
+++ b/devtools/server/actors/device.js
@@ -1,25 +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/. */
 
 "use strict";
 
-const {Ci} = require("chrome");
 const Services = require("Services");
 const protocol = require("devtools/shared/protocol");
 const promise = require("promise");
 const {LongStringActor} = require("devtools/server/actors/string");
 const {DebuggerServer} = require("devtools/server/main");
 const {getSystemInfo, getSetting} = require("devtools/shared/system");
 const {deviceSpec} = require("devtools/shared/specs/device");
 const FileReader = require("FileReader");
 
-var DeviceActor = exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
+exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
   _desc: null,
 
   getDescription: function () {
     return getSystemInfo();
   },
 
   getWallpaper: function () {
     let deferred = promise.defer();
@@ -35,17 +34,17 @@ var DeviceActor = exports.DeviceActor = 
       });
       reader.readAsDataURL(blob);
     });
     return deferred.promise;
   },
 
   screenshotToDataURL: function () {
     let window = Services.wm.getMostRecentWindow(DebuggerServer.chromeWindowType);
-    var devicePixelRatio = window.devicePixelRatio;
+    let { devicePixelRatio } = window;
     let canvas = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
     let width = window.innerWidth;
     let height = window.innerHeight;
     canvas.setAttribute("width", Math.round(width * devicePixelRatio));
     canvas.setAttribute("height", Math.round(height * devicePixelRatio));
     let context = canvas.getContext("2d");
     let flags =
           context.DRAWWINDOW_DRAW_CARET |
--- a/devtools/server/actors/director-manager.js
+++ b/devtools/server/actors/director-manager.js
@@ -4,18 +4,17 @@
 
 "use strict";
 
 const events = require("sdk/event/core");
 const protocol = require("devtools/shared/protocol");
 
 const { Cu, Ci } = require("chrome");
 
-const { on, once, off, emit } = events;
-const { method, Arg, Option, RetVal, types } = protocol;
+const { on, off, emit } = events;
 
 const { sandbox, evaluate } = require("sdk/loader/sandbox");
 const { Class } = require("sdk/core/heritage");
 
 const { PlainTextConsole } = require("sdk/console/plain-text");
 
 const { DirectorRegistry } = require("./director-registry");
 
@@ -33,17 +32,17 @@ const ERR_MESSAGEPORT_FINALIZED = "messa
 
 const ERR_DIRECTOR_UNKNOWN_SCRIPTID = "unkown director-script id";
 const ERR_DIRECTOR_UNINSTALLED_SCRIPTID = "uninstalled director-script id";
 
 /**
  * A MessagePort Actor allowing communication through messageport events
  * over the remote debugging protocol.
  */
-var MessagePortActor = exports.MessagePortActor = protocol.ActorClassWithSpec(messagePortSpec, {
+var MessagePortActor = protocol.ActorClassWithSpec(messagePortSpec, {
   /**
    * Create a MessagePort actor.
    *
    * @param DebuggerServerConnection conn
    *        The server connection.
    * @param MessagePort port
    *        The wrapped MessagePort.
    */
@@ -86,17 +85,17 @@ var MessagePortActor = exports.MessagePo
 
     // NOTE: set port.onmessage to a function is an implicit start
     // and starts to send queued messages.
     // On the client side we should set MessagePortClient.onmessage
     // to a setter which register an handler to the message event
     // and call the actor start method to start receiving messages
     // from the MessagePort's queue.
     this.port.onmessage = (evt) => {
-      var ports;
+      let ports;
 
       // TODO: test these wrapped ports
       if (Array.isArray(evt.ports)) {
         ports = evt.ports.map((port) => {
           let actor = new MessagePortActor(this.conn, port);
           this.manage(actor);
           return actor;
         });
@@ -133,28 +132,30 @@ var MessagePortActor = exports.MessagePo
   },
 
   finalize: function () {
     this.close();
     this.port = null;
   },
 });
 
+exports.MessagePortActor = MessagePortActor;
+
 /**
- * The Director Script Actor manage javascript code running in a non-privileged sandbox with the same
- * privileges of the target global (browser tab or a firefox os app).
+ * The Director Script Actor manage javascript code running in a non-privileged sandbox
+ * with the same privileges of the target global (browser tab or a firefox os app).
  *
- * After retrieving an instance of this actor (from the tab director actor), you'll need to set it up
- * by calling setup().
+ * After retrieving an instance of this actor (from the tab director actor), you'll
+ * need to set it up by calling setup().
  *
- * After the setup, this actor will automatically attach/detach the content script (and optionally a
- * directly connect the debugger client and the content script using a MessageChannel) on tab
- * navigation.
+ * After the setup, this actor will automatically attach/detach the content script
+ * (and optionally a directly connect the debugger client and the content script using
+ * a MessageChannel) on tab navigation.
  */
-var DirectorScriptActor = exports.DirectorScriptActor = protocol.ActorClassWithSpec(directorScriptSpec, {
+var DirectorScriptActor = protocol.ActorClassWithSpec(directorScriptSpec, {
   /**
    * Creates the director script actor
    *
    * @param DebuggerServerConnection conn
    *        The server connection.
    * @param Actor tabActor
    *        The tab (or root) actor.
    * @param String scriptId
@@ -179,18 +180,18 @@ var DirectorScriptActor = exports.Direct
   },
   destroy: function (conn) {
     protocol.Actor.prototype.destroy.call(this, conn);
 
     this.finalize();
   },
 
   /**
-   * Starts listening to the tab global created, in order to create the director-script sandbox
-   * using the configured scriptCode, attached/detached automatically to the tab
+   * Starts listening to the tab global created, in order to create the director-script
+   * sandbox using the configured scriptCode, attached/detached automatically to the tab
    * window on tab navigation.
    *
    * @param Boolean reload
    *        attach the page immediately or reload it first.
    * @param Boolean skipAttach
    *        skip the attach
    */
   setup: function ({ reload, skipAttach }) {
@@ -199,26 +200,31 @@ var DirectorScriptActor = exports.Direct
       return;
     }
 
     this._setupCalled = true;
 
     on(this.tabActor, "window-ready", this._onGlobalCreated);
     on(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
 
-    // optional skip attach (needed by director-manager for director scripts bulk activation)
+    // optional skip attach (needed by director-manager for director scripts
+    // bulk activation)
     if (skipAttach) {
       return;
     }
 
     if (reload) {
       this.window.location.reload();
     } else {
       // fake a global created event to attach without reload
-      this._onGlobalCreated({ id: getWindowID(this.window), window: this.window, isTopLevel: true });
+      this._onGlobalCreated({
+        id: getWindowID(this.window),
+        window: this.window,
+        isTopLevel: true
+      });
     }
   },
 
   /**
    * Get the attached MessagePort actor if any
    */
   getMessagePort: function () {
     return this._messagePortActor;
@@ -267,17 +273,17 @@ var DirectorScriptActor = exports.Direct
       this._scriptSandbox = new DirectorScriptSandbox({
         scriptId: this._scriptId,
         scriptCode: this._scriptCode,
         scriptOptions: this._scriptOptions
       });
 
       // attach the global window
       this._lastAttachedWinId = id;
-      var port = this._scriptSandbox.attach(window, id);
+      let port = this._scriptSandbox.attach(window, id);
       this._onDirectorScriptAttach(window, port);
     } catch (e) {
       this._onDirectorScriptError(e);
     }
   },
   _onGlobalDestroyed: function ({ id }) {
     if (id !== this._lastAttachedWinId) {
        // filter destroyed globals
@@ -329,20 +335,23 @@ var DirectorScriptActor = exports.Direct
       directorScriptId: this._scriptId,
       url: (window && window.location) ? window.location.toString() : "",
       innerId: this._lastAttachedWinId,
       port: this._messagePortActor
     });
   }
 });
 
+exports.DirectorScriptActor = DirectorScriptActor;
+
 /**
- * The DirectorManager Actor is a tab actor which manages enabling/disabling director scripts.
+ * The DirectorManager Actor is a tab actor which manages enabling/disabling
+ * director scripts.
  */
-const DirectorManagerActor = exports.DirectorManagerActor = protocol.ActorClassWithSpec(directorManagerSpec, {
+exports.DirectorManagerActor = protocol.ActorClassWithSpec(directorManagerSpec, {
   /* init & destroy methods */
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this._directorScriptActorsMap = new Map();
   },
   destroy: function (conn) {
     protocol.Actor.prototype.destroy.call(this, conn);
@@ -433,33 +442,32 @@ const DirectorManagerActor = exports.Dir
     }
   },
 
   /**
    * Retrieves the actor instance of an installed director-script
    * (and create the actor instance if it doesn't exists yet).
    */
   getByScriptId: function (scriptId) {
-    var id = scriptId;
+    let id = scriptId;
     // raise an unknown director-script id exception
     if (!DirectorRegistry.checkInstalled(id)) {
       console.error(ERR_DIRECTOR_UNKNOWN_SCRIPTID, id);
       throw Error(ERR_DIRECTOR_UNKNOWN_SCRIPTID);
     }
 
     // get a previous created actor instance
     let actor = this._directorScriptActorsMap.get(id);
 
     // create a new actor instance
     if (!actor) {
       let directorScriptDefinition = DirectorRegistry.get(id);
 
       // test lazy director-script (e.g. uninstalled in the parent process)
       if (!directorScriptDefinition) {
-
         console.error(ERR_DIRECTOR_UNINSTALLED_SCRIPTID, id);
         throw Error(ERR_DIRECTOR_UNINSTALLED_SCRIPTID);
       }
 
       actor = new DirectorScriptActor(this.conn, this.tabActor, directorScriptDefinition);
       this._directorScriptActorsMap.set(id, actor);
 
       on(actor, "error", emit.bind(null, this, "director-script-error"));
@@ -486,22 +494,22 @@ const DirectorManagerActor = exports.Dir
 const DirectorScriptSandbox = Class({
   initialize: function ({scriptId, scriptCode, scriptOptions}) {
     this._scriptId = scriptId;
     this._scriptCode = scriptCode;
     this._scriptOptions = scriptOptions;
   },
 
   attach: function (window, innerId) {
-    this._innerId = innerId,
+    this._innerId = innerId;
     this._window = window;
     this._proto = Cu.createObjectIn(this._window);
 
-    var id = this._scriptId;
-    var uri = this._scriptCode;
+    let id = this._scriptId;
+    let uri = this._scriptCode;
 
     this._sandbox = sandbox(window, {
       sandboxName: uri,
       sandboxPrototype: this._proto,
       sameZoneAs: window,
       wantXrays: true,
       wantComponents: false,
       wantExportHelpers: false,
@@ -510,75 +518,83 @@ const DirectorScriptSandbox = Class({
         addonID: id,
         SDKDirectorScript: true,
         "inner-window-id": innerId
       }
     });
 
     // create a CommonJS module object which match the interface from addon-sdk
     // (addon-sdk/sources/lib/toolkit/loader.js#L678-L686)
-    var module = Cu.cloneInto(Object.create(null, {
+    let module = Cu.cloneInto(Object.create(null, {
       id: { enumerable: true, value: id },
       uri: { enumerable: true, value: uri },
       exports: { enumerable: true, value: Cu.createObjectIn(this._sandbox) }
     }), this._sandbox);
 
     // create a console API object
     let directorScriptConsole = new PlainTextConsole(null, this._innerId);
 
     // inject CommonJS module globals into the sandbox prototype
     Object.defineProperties(this._proto, {
       module: { enumerable: true, value: module },
       exports: { enumerable: true, value: module.exports },
       console: {
         enumerable: true,
-        value: Cu.cloneInto(directorScriptConsole, this._sandbox, { cloneFunctions: true })
+        value: Cu.cloneInto(
+          directorScriptConsole,
+          this._sandbox,
+          { cloneFunctions: true }
+        )
       }
     });
 
     Object.defineProperties(this._sandbox, {
       require: {
         enumerable: true,
         value: Cu.cloneInto(function () {
           throw Error("NOT IMPLEMENTED");
         }, this._sandbox, { cloneFunctions: true })
       }
     });
 
     // TODO: if the debugger target is local, the debugger client could pass
-    // to the director actor the resource url instead of the entire javascript source code.
+    // to the director actor the resource url instead of the entire javascript
+    // source code.
 
     // evaluate the director script source in the sandbox
     evaluate(this._sandbox, this._scriptCode, "javascript:" + this._scriptCode);
 
     // prepare the messageport connected to the debugger client
     let { port1, port2 } = new this._window.MessageChannel();
 
     // prepare the unload callbacks queue
-    var sandboxOnUnloadQueue = this._sandboxOnUnloadQueue = [];
+    let sandboxOnUnloadQueue = this._sandboxOnUnloadQueue = [];
 
     // create the attach options
-    var attachOptions = this._attachOptions = Cu.createObjectIn(this._sandbox);
+    let attachOptions = this._attachOptions = Cu.createObjectIn(this._sandbox);
     Object.defineProperties(attachOptions, {
       port: { enumerable: true, value: port1 },
       window: { enumerable: true, value: window },
-      scriptOptions: { enumerable: true, value: Cu.cloneInto(this._scriptOptions, this._sandbox) },
+      scriptOptions: {
+        enumerable: true,
+        value: Cu.cloneInto(this._scriptOptions, this._sandbox)
+      },
       onUnload: {
         enumerable: true,
         value: Cu.cloneInto(function (cb) {
           // collect unload callbacks
           if (typeof cb == "function") {
             sandboxOnUnloadQueue.push(cb);
           }
         }, this._sandbox, { cloneFunctions: true })
       }
     });
 
     // select the attach method
-    var exports = this._proto.module.exports;
+    let exports = this._proto.module.exports;
     if (this._scriptOptions && "attachMethod" in this._scriptOptions) {
       this._sandboxOnAttach = exports[this._scriptOptions.attachMethod];
     } else {
       this._sandboxOnAttach = exports;
     }
 
     if (typeof this._sandboxOnAttach !== "function") {
       throw Error("the configured attachMethod '" +
@@ -586,17 +602,17 @@ const DirectorScriptSandbox = Class({
                   "' is not exported by the directorScript");
     }
 
     // call the attach method
     this._sandboxOnAttach.call(this._sandbox, attachOptions);
 
     return port2;
   },
-  destroy:  function (onError) {
+  destroy: function (onError) {
     // evaluate queue unload methods if any
     while (this._sandboxOnUnloadQueue && this._sandboxOnUnloadQueue.length > 0) {
       let cb = this._sandboxOnUnloadQueue.pop();
 
       try {
         cb();
       } catch (e) {
         console.error("Exception on DirectorScript Sandbox destroy", e);
--- a/devtools/server/actors/director-registry.js
+++ b/devtools/server/actors/director-registry.js
@@ -16,18 +16,20 @@ const {directorRegistrySpec} = require("
  * Error Messages
  */
 
 const ERR_DIRECTOR_INSTALL_TWICE = "Trying to install a director-script twice";
 const ERR_DIRECTOR_INSTALL_EMPTY = "Trying to install an empty director-script";
 const ERR_DIRECTOR_UNINSTALL_UNKNOWN = "Trying to uninstall an unkown director-script";
 
 const ERR_DIRECTOR_PARENT_UNKNOWN_METHOD = "Unknown parent process method";
-const ERR_DIRECTOR_CHILD_NOTIMPLEMENTED_METHOD = "Unexpected call to notImplemented method";
-const ERR_DIRECTOR_CHILD_MULTIPLE_REPLIES = "Unexpected multiple replies to called parent method";
+const ERR_DIRECTOR_CHILD_NOTIMPLEMENTED_METHOD =
+  "Unexpected call to notImplemented method";
+const ERR_DIRECTOR_CHILD_MULTIPLE_REPLIES =
+  "Unexpected multiple replies to called parent method";
 const ERR_DIRECTOR_CHILD_NO_REPLY = "Unexpected no reply to called parent method";
 
 /**
  * Director Registry
  */
 
 // Map of director scripts ids to director script definitions
 var gDirectorScripts = Object.create(null);
@@ -143,17 +145,17 @@ exports.setupParentProcess = function se
     onDisconnected: () => setMessageManager(null),
   };
 };
 
 /**
  * The DirectorRegistry Actor is a global actor which manages install/uninstall of
  * director scripts definitions.
  */
-const DirectorRegistryActor = exports.DirectorRegistryActor = protocol.ActorClassWithSpec(directorRegistrySpec, {
+exports.DirectorRegistryActor = protocol.ActorClassWithSpec(directorRegistrySpec, {
   /* init & destroy methods */
   initialize: function (conn, parentActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.maybeSetupChildProcess(conn);
   },
   destroy: function (conn) {
     protocol.Actor.prototype.destroy.call(this, conn);
     this.finalize();
@@ -186,17 +188,17 @@ const DirectorRegistryActor = exports.Di
     /* child process helpers */
 
     function notImplemented(method) {
       console.error(ERR_DIRECTOR_CHILD_NOTIMPLEMENTED_METHOD, method);
       throw Error(ERR_DIRECTOR_CHILD_NOTIMPLEMENTED_METHOD);
     }
 
     function callParentProcess(method, ...args) {
-      var reply = sendSyncMessage("debug:director-registry-request", {
+      let reply = sendSyncMessage("debug:director-registry-request", {
         method: method,
         args: args
       });
 
       if (reply.length === 0) {
         console.error(ERR_DIRECTOR_CHILD_NO_REPLY);
         throw Error(ERR_DIRECTOR_CHILD_NO_REPLY);
       } else if (reply.length > 1) {
--- a/devtools/server/actors/environment.js
+++ b/devtools/server/actors/environment.js
@@ -1,15 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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/. */
 "use strict";
 
+/* global Debugger */
+
 const { ActorClassWithSpec } = require("devtools/shared/protocol");
 const { createValueGrip } = require("devtools/server/actors/object");
 const { environmentSpec } = require("devtools/shared/specs/environment");
 
 /**
  * Creates an EnvironmentActor. EnvironmentActors are responsible for listing
  * the bindings introduced by a lexical environment and assigning new values to
  * those identifier bindings.
@@ -85,20 +87,21 @@ let EnvironmentActor = ActorClassWithSpe
                message: "Changing the value of an immutable binding is not " +
                         "allowed" };
     }*/
 
     try {
       this.obj.setVariable(name, value);
     } catch (e) {
       if (e instanceof Debugger.DebuggeeWouldRun) {
-        throw {
+        const errorObject = {
           error: "threadWouldRun",
           message: "Assigning a value would cause the debuggee to run"
         };
+        throw errorObject;
       } else {
         throw e;
       }
     }
     return { from: this.actorID };
   },
 
   /**
--- a/devtools/server/actors/errordocs.js
+++ b/devtools/server/actors/errordocs.js
@@ -5,17 +5,18 @@
 /**
  * A mapping of error message names to external documentation. Any error message
  * included here will be displayed alongside its link in the web console.
  */
 
 "use strict";
 
 const baseURL = "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/";
-const params = "?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default";
+const params =
+  "?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default";
 const ErrorDocs = {
   JSMSG_READ_ONLY: "Read-only",
   JSMSG_BAD_ARRAY_LENGTH: "Invalid_array_length",
   JSMSG_NEGATIVE_REPETITION_COUNT: "Negative_repetition_count",
   JSMSG_RESULTING_STRING_TOO_LARGE: "Resulting_string_too_large",
   JSMSG_BAD_RADIX: "Bad_radix",
   JSMSG_PRECISION_RANGE: "Precision_range",
   JSMSG_STMT_AFTER_RETURN: "Stmt_after_return",
@@ -66,21 +67,22 @@ const ErrorCategories = {
   "Invalid HSTS Headers": STRICT_TRANSPORT_SECURITY_LEARN_MORE,
   "SHA-1 Signature": WEAK_SIGNATURE_ALGORITHM_LEARN_MORE,
   "Tracking Protection": TRACKING_PROTECTION_LEARN_MORE,
   "MIMEMISMATCH": MIME_TYPE_MISMATCH_LEARN_MORE,
 };
 
 exports.GetURL = (error) => {
   if (!error) {
-    return;
+    return undefined;
   }
 
   let doc = ErrorDocs[error.errorMessageName];
   if (doc) {
     return baseURL + doc + params;
   }
 
   let categoryURL = ErrorCategories[error.category];
   if (categoryURL) {
     return categoryURL + params;
   }
+  return undefined;
 };
--- a/devtools/server/actors/eventlooplag.js
+++ b/devtools/server/actors/eventlooplag.js
@@ -12,17 +12,17 @@
 
 const {Ci} = require("chrome");
 const Services = require("Services");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const {Actor, ActorClassWithSpec} = require("devtools/shared/protocol");
 const events = require("sdk/event/core");
 const {eventLoopLagSpec} = require("devtools/shared/specs/eventlooplag");
 
-var EventLoopLagActor = exports.EventLoopLagActor = ActorClassWithSpec(eventLoopLagSpec, {
+exports.EventLoopLagActor = ActorClassWithSpec(eventLoopLagSpec, {
   _observerAdded: false,
 
   /**
    * Start tracking the event loop lags.
    */
   start: function () {
     if (!this._observerAdded) {
       Services.obs.addObserver(this, "event-loop-lag", false);
--- a/devtools/server/actors/frame.js
+++ b/devtools/server/actors/frame.js
@@ -67,17 +67,17 @@ let FrameActor = ActorClassWithSpec(fram
         this.frameLifetimePool
       );
       form.environment = envActor.form();
     }
     form.this = createValueGrip(this.frame.this, threadActor._pausePool,
       threadActor.objectGrip);
     form.arguments = this._args();
     if (this.frame.script) {
-      var generatedLocation = this.threadActor.sources.getFrameLocation(this.frame);
+      let generatedLocation = this.threadActor.sources.getFrameLocation(this.frame);
       form.where = {
         source: generatedLocation.generatedSourceActor.form(),
         line: generatedLocation.generatedLine,
         column: generatedLocation.generatedColumn
       };
     }
 
     if (!this.frame.older) {
--- a/devtools/server/actors/framerate.js
+++ b/devtools/server/actors/framerate.js
@@ -1,26 +1,25 @@
 /* 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/. */
 "use strict";
 
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
-const { on, once, off, emit } = require("sdk/event/core");
 const { Framerate } = require("devtools/server/performance/framerate");
 const { framerateSpec } = require("devtools/shared/specs/framerate");
 
 /**
  * An actor wrapper around Framerate. Uses exposed
  * methods via bridge and provides RDP definitions.
  *
  * @see devtools/server/performance/framerate.js for documentation.
  */
-var FramerateActor = exports.FramerateActor = ActorClassWithSpec(framerateSpec, {
+exports.FramerateActor = ActorClassWithSpec(framerateSpec, {
   initialize: function (conn, tabActor) {
     Actor.prototype.initialize.call(this, conn);
     this.bridge = new Framerate(tabActor);
   },
   destroy: function (conn) {
     Actor.prototype.destroy.call(this, conn);
     this.bridge.destroy();
   },
--- a/devtools/server/actors/gcli.js
+++ b/devtools/server/actors/gcli.js
@@ -1,33 +1,31 @@
 /* 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/. */
 
 "use strict";
 
-const { Task } = require("devtools/shared/task");
-const {
-  method, Arg, Option, RetVal, Actor, ActorClassWithSpec
-} = require("devtools/shared/protocol");
+const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { gcliSpec } = require("devtools/shared/specs/gcli");
 const events = require("sdk/event/core");
 const { createSystem } = require("gcli/system");
 
 /**
  * Manage remote connections that want to talk to GCLI
  */
 const GcliActor = ActorClassWithSpec(gcliSpec, {
   initialize: function (conn, tabActor) {
     Actor.prototype.initialize.call(this, conn);
 
     this._commandsChanged = this._commandsChanged.bind(this);
 
     this._tabActor = tabActor;
-    this._requisitionPromise = undefined; // see _getRequisition()
+    // see _getRequisition()
+    this._requisitionPromise = undefined;
   },
 
   destroy: function () {
     Actor.prototype.destroy.call(this);
 
     // If _getRequisition has not been called, just bail quickly
     if (this._requisitionPromise == null) {
       this._commandsChanged = undefined;
@@ -191,21 +189,23 @@ const GcliActor = ActorClassWithSpec(gcl
     gcliInit.addAllItemsByModule(this._system);
 
     // this._requisitionPromise should be created synchronously with the call
     // to _getRequisition so that destroy can tell whether there is an async
     // init in progress
     this._requisitionPromise = this._system.load().then(() => {
       const environment = {
         get chromeWindow() {
-          throw new Error("environment.chromeWindow is not available in runAt:server commands");
+          throw new Error("environment.chromeWindow is not available in runAt:server" +
+            " commands");
         },
 
         get chromeDocument() {
-          throw new Error("environment.chromeDocument is not available in runAt:server commands");
+          throw new Error("environment.chromeDocument is not available in runAt:server" +
+            " commands");
         },
 
         get window() {
           return tabActor.window;
         },
 
         get document() {
           return tabActor.window && tabActor.window.document;
--- a/devtools/server/actors/heap-snapshot-file.js
+++ b/devtools/server/actors/heap-snapshot-file.js
@@ -1,16 +1,15 @@
 /* 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/. */
 
 "use strict";
 
 const protocol = require("devtools/shared/protocol");
-const { method, Arg } = protocol;
 const Services = require("Services");
 const { Task } = require("devtools/shared/task");
 
 const { heapSnapshotFileSpec } = require("devtools/shared/specs/heap-snapshot-file");
 
 loader.lazyRequireGetter(this, "DevToolsUtils",
                          "devtools/shared/DevToolsUtils");
 loader.lazyRequireGetter(this, "OS", "resource://gre/modules/osfile.jsm", true);
--- a/devtools/server/actors/highlighters.js
+++ b/devtools/server/actors/highlighters.js
@@ -77,17 +77,17 @@ exports.register = register;
  *
  * Other types of highlighter actors exist and can be accessed via the
  * InspectorActor's 'getHighlighterByType' method.
  */
 
 /**
  * The HighlighterActor class
  */
-var HighlighterActor = exports.HighlighterActor = protocol.ActorClassWithSpec(highlighterSpec, {
+exports.HighlighterActor = protocol.ActorClassWithSpec(highlighterSpec, {
   initialize: function (inspector, autohide) {
     protocol.Actor.prototype.initialize.call(this, null);
 
     this._autohide = autohide;
     this._inspector = inspector;
     this._walker = this._inspector.walker;
     this._tabActor = this._inspector.tabActor;
     this._highlighterEnv = new HighlighterEnvironment();
@@ -250,17 +250,18 @@ var HighlighterActor = exports.Highlight
 
       if (!this._isEventAllowed(event)) {
         return;
       }
 
       // If shift is pressed, this is only a preview click, send the event to
       // the client, but don't stop picking.
       if (event.shiftKey) {
-        events.emit(this._walker, "picker-node-previewed", this._findAndAttachElement(event));
+        events.emit(this._walker, "picker-node-previewed",
+          this._findAndAttachElement(event));
         return;
       }
 
       this._stopPickerListeners();
       this._isPicking = false;
       if (this._autohide) {
         this._tabActor.window.setTimeout(() => {
           this._highlighter.hide();
@@ -346,18 +347,18 @@ var HighlighterActor = exports.Highlight
           this.cancelPick();
           events.emit(this._walker, "picker-node-canceled");
           return;
         case Ci.nsIDOMKeyEvent.DOM_VK_C:
           if ((IS_OSX && event.metaKey && event.altKey) ||
             (!IS_OSX && event.ctrlKey && event.shiftKey)) {
             this.cancelPick();
             events.emit(this._walker, "picker-node-canceled");
-            return;
           }
+          return;
         default: return;
       }
 
       // Store currently attached element
       this._currentNode = this._walker.attachElement(currentNode);
       this._highlighter.show(this._currentNode.node.rawNode);
       events.emit(this._walker, "picker-node-hovered", this._currentNode);
     };
@@ -365,17 +366,17 @@ var HighlighterActor = exports.Highlight
     this._startPickerListeners();
 
     return null;
   },
 
   /**
    * This pick method also focuses the highlighter's target window.
    */
-  pickAndFocus: function() {
+  pickAndFocus: function () {
     // Go ahead and pass on the results to help future-proof this method.
     let pickResults = this.pick();
     this._highlighterEnv.window.focus();
     return pickResults;
   },
 
   _findAndAttachElement: function (event) {
     // originalTarget allows access to the "real" element before any retargeting
@@ -424,17 +425,17 @@ var HighlighterActor = exports.Highlight
     }
   }
 });
 
 /**
  * A generic highlighter actor class that instantiate a highlighter given its
  * type name and allows to show/hide it.
  */
-var CustomHighlighterActor = exports.CustomHighlighterActor = protocol.ActorClassWithSpec(customHighlighterSpec, {
+exports.CustomHighlighterActor = protocol.ActorClassWithSpec(customHighlighterSpec, {
   /**
    * Create a highlighter instance given its typename
    * The typename must be one of HIGHLIGHTER_CLASSES and the class must
    * implement constructor(tabActor), show(node), hide(), destroy()
    */
   initialize: function (inspector, typeName) {
     protocol.Actor.prototype.initialize.call(this, null);
 
--- a/devtools/server/actors/monitor.js
+++ b/devtools/server/actors/monitor.js
@@ -3,18 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Ci, Cc} = require("chrome");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const Services = require("Services");
 
-function MonitorActor(aConnection) {
-  this.conn = aConnection;
+function MonitorActor(connection) {
+  this.conn = connection;
   this._updates = [];
   this._started = false;
 }
 
 MonitorActor.prototype = {
   actorPrefix: "monitor",
 
   // Updates.
@@ -113,31 +113,33 @@ var USSAgent = {
   _timeout: null,
   _packet: {
     graph: "USS",
     time: null,
     value: null
   },
 
   start: function () {
-    USSAgent._mgr = Cc["@mozilla.org/memory-reporter-manager;1"].getService(Ci.nsIMemoryReporterManager);
+    USSAgent._mgr = Cc["@mozilla.org/memory-reporter-manager;1"].getService(
+      Ci.nsIMemoryReporterManager);
     if (!USSAgent._mgr.residentUnique) {
-      throw "Couldn't get USS.";
+      throw new Error("Couldn't get USS.");
     }
     USSAgent.update();
   },
 
   update: function () {
     if (!USSAgent._mgr) {
       USSAgent.stop();
       return;
     }
     USSAgent._packet.time = Date.now();
     USSAgent._packet.value = USSAgent._mgr.residentUnique;
-    Services.obs.notifyObservers(null, "devtools-monitor-update", JSON.stringify(USSAgent._packet));
+    Services.obs.notifyObservers(null, "devtools-monitor-update",
+      JSON.stringify(USSAgent._packet));
     USSAgent._timeout = setTimeout(USSAgent.update, 300);
   },
 
   stop: function () {
     clearTimeout(USSAgent._timeout);
     USSAgent._mgr = null;
   }
 };
--- a/devtools/server/actors/performance-entries.js
+++ b/devtools/server/actors/performance-entries.js
@@ -1,12 +1,14 @@
 /* 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/. */
 
+"use strict";
+
 /**
  * The performanceEntries actor emits events corresponding to performance
  * entries. It receives `performanceentry` events containing the performance
  * entry details and emits an event containing the name, type, origin, and
  * epoch of the performance entry.
  */
 
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
--- a/devtools/server/actors/performance-recording.js
+++ b/devtools/server/actors/performance-recording.js
@@ -1,15 +1,14 @@
 /* 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/. */
 
 "use strict";
 
-const { Cu } = require("chrome");
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { performanceRecordingSpec } = require("devtools/shared/specs/performance-recording");
 
 loader.lazyRequireGetter(this, "merge", "sdk/util/object", true);
 loader.lazyRequireGetter(this, "RecordingUtils",
   "devtools/shared/performance/recording-utils");
 loader.lazyRequireGetter(this, "PerformanceRecordingCommon",
   "devtools/shared/performance/recording-common", true);
@@ -22,17 +21,18 @@ loader.lazyRequireGetter(this, "Performa
  */
 const PerformanceRecordingActor = ActorClassWithSpec(performanceRecordingSpec, merge({
   form: function (detail) {
     if (detail === "actorid") {
       return this.actorID;
     }
 
     let form = {
-      actor: this.actorID,  // actorID is set when this is added to a pool
+      // actorID is set when this is added to a pool
+      actor: this.actorID,
       configuration: this._configuration,
       startingBufferStatus: this._startingBufferStatus,
       console: this._console,
       label: this._label,
       startTime: this._startTime,
       localStartTime: this._localStartTime,
       recording: this._recording,
       completed: this._completed,
--- a/devtools/server/actors/performance.js
+++ b/devtools/server/actors/performance.js
@@ -1,15 +1,14 @@
 /* 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/. */
 
 "use strict";
 
-const { Cu } = require("chrome");
 const { Task } = require("devtools/shared/task");
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
 const { performanceSpec } = require("devtools/shared/specs/performance");
 
 loader.lazyRequireGetter(this, "events", "sdk/event/core");
 loader.lazyRequireGetter(this, "extend", "sdk/util/object", true);
 
--- a/devtools/server/actors/preference.js
+++ b/devtools/server/actors/preference.js
@@ -1,26 +1,28 @@
 /* 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/. */
 
-const {Cc, Ci, Cu, CC} = require("chrome");
+"use strict";
+
+const {Ci} = require("chrome");
 const protocol = require("devtools/shared/protocol");
-const {Arg, method, RetVal} = protocol;
 const Services = require("Services");
 const {preferenceSpec} = require("devtools/shared/specs/preference");
 
 exports.register = function (handle) {
   handle.addGlobalActor(PreferenceActor, "preferenceActor");
 };
 
 exports.unregister = function (handle) {
 };
 
-var PreferenceActor = exports.PreferenceActor = protocol.ActorClassWithSpec(preferenceSpec, {
+var PreferenceActor = protocol.ActorClassWithSpec(preferenceSpec, {
+
   typeName: "preference",
 
   getBoolPref: function (name) {
     return Services.prefs.getBoolPref(name);
   },
 
   getCharPref: function (name) {
     return Services.prefs.getCharPref(name);
@@ -74,8 +76,10 @@ var PreferenceActor = exports.Preference
     Services.prefs.savePrefFile(null);
   },
 
   clearUserPref: function (name) {
     Services.prefs.clearUserPref(name);
     Services.prefs.savePrefFile(null);
   },
 });
+
+exports.PreferenceActor = PreferenceActor;
--- a/devtools/server/actors/pretty-print-worker.js
+++ b/devtools/server/actors/pretty-print-worker.js
@@ -1,14 +1,18 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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/. */
 
+"use strict";
+
+/* global importScripts, workerHelper, self, prettyFast */
+
 /**
  * This file is meant to be loaded as a ChromeWorker. It accepts messages which
  * have data of the form:
  *
  *     { id, url, indent, source }
  *
  * Where `id` is a unique ID to identify this request, `url` is the url of the
  * source being pretty printed, `indent` is the number of spaces to indent the
@@ -38,13 +42,12 @@ workerHelper.createTask(self, "pretty-pr
       url: url,
       indent: " ".repeat(indent)
     });
 
     return {
       code: prettified.code,
       mappings: prettified.map._mappings
     };
-  }
-  catch (e) {
+  } catch (e) {
     return new Error(e.message + "\n" + e.stack);
   }
 });
--- a/devtools/server/actors/process.js
+++ b/devtools/server/actors/process.js
@@ -2,36 +2,41 @@
  * 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/. */
 
 "use strict";
 
 var { Cc, Ci } = require("chrome");
 
 loader.lazyGetter(this, "ppmm", () => {
-  return Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(Ci.nsIMessageBroadcaster);
+  return Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(
+    Ci.nsIMessageBroadcaster);
 });
 
 function ProcessActorList() {
   this._actors = new Map();
   this._onListChanged = null;
   this._mustNotify = false;
 
   this._onMessage = this._onMessage.bind(this);
   this._processScript = "data:text/javascript,sendAsyncMessage('debug:new-process');";
 }
 
 ProcessActorList.prototype = {
   getList: function () {
     let processes = [];
     for (let i = 0; i < ppmm.childCount; i++) {
       processes.push({
-        id: i, // XXX: may not be a perfect id, but process message manager doesn't expose anything...
-        parent: i == 0, // XXX Weak, but appear to be stable
-        tabCount: undefined, // TODO: exposes process message manager on frameloaders in order to compute this
+        // XXX: may not be a perfect id, but process message manager doesn't
+        // expose anything...
+        id: i,
+        // XXX Weak, but appear to be stable
+        parent: i == 0,
+        // TODO: exposes process message manager on frameloaders in order to compute this
+        tabCount: undefined,
       });
     }
     this._mustNotify = true;
     this._checkListening();
 
     return processes;
   },
 
--- a/devtools/server/actors/profiler.js
+++ b/devtools/server/actors/profiler.js
@@ -11,17 +11,17 @@ const { profilerSpec } = require("devtoo
 loader.lazyRequireGetter(this, "events", "sdk/event/core");
 
 /**
  * This actor wraps the Profiler module at devtools/server/performance/profiler.js
  * and provides RDP definitions.
  *
  * @see devtools/server/performance/profiler.js for documentation.
  */
-var ProfilerActor = exports.ProfilerActor = ActorClassWithSpec(profilerSpec, {
+exports.ProfilerActor = ActorClassWithSpec(profilerSpec, {
   initialize: function (conn) {
     Actor.prototype.initialize.call(this, conn);
     this._onProfilerEvent = this._onProfilerEvent.bind(this);
 
     this.bridge = new Profiler();
     events.on(this.bridge, "*", this._onProfilerEvent);
   },
 
--- a/devtools/server/actors/reflow.js
+++ b/devtools/server/actors/reflow.js
@@ -22,26 +22,25 @@
  * - Dedicated observers: There's only one of them for now: ReflowObserver which
  *   listens to reflow events via the docshell,
  *   These dedicated classes are used by the LayoutChangesObserver.
  */
 
 const {Ci} = require("chrome");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const protocol = require("devtools/shared/protocol");
-const {method, Arg} = protocol;
 const events = require("sdk/event/core");
 const Heritage = require("sdk/core/heritage");
 const EventEmitter = require("devtools/shared/event-emitter");
 const {reflowSpec} = require("devtools/shared/specs/reflow");
 
 /**
  * The reflow actor tracks reflows and emits events about them.
  */
-var ReflowActor = exports.ReflowActor = protocol.ActorClassWithSpec(reflowSpec, {
+exports.ReflowActor = protocol.ActorClassWithSpec(reflowSpec, {
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
 
     this.tabActor = tabActor;
     this._onReflow = this._onReflow.bind(this);
     this.observer = getLayoutChangesObserver(tabActor);
     this._isStarted = false;
   },
@@ -194,17 +193,17 @@ Observable.prototype = {
  * either observed or ignored depending on the current mode.
  *
  * @param {Boolean} ignore
  * @param {DOMNode} syncReflowNode The node to use to force a sync reflow
  */
 var gIgnoreLayoutChanges = false;
 exports.setIgnoreLayoutChanges = function (ignore, syncReflowNode) {
   if (syncReflowNode) {
-    let forceSyncReflow = syncReflowNode.offsetWidth;
+    let forceSyncReflow = syncReflowNode.offsetWidth; // eslint-disable-line
   }
   gIgnoreLayoutChanges = ignore;
 };
 
 /**
  * The LayoutChangesObserver class is instantiated only once per given tab
  * and is used to track reflows and dom and style changes in that tab.
  * The LayoutActor uses this class to send reflow events to its clients.
@@ -427,17 +426,17 @@ exports.releaseLayoutChangesObserver = r
  * @param {Function} callback Executed everytime a reflow occurs
  */
 function ReflowObserver(tabActor, callback) {
   Observable.call(this, tabActor, callback);
 }
 
 ReflowObserver.prototype = Heritage.extend(Observable.prototype, {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
-    Ci.nsISupportsWeakReference]),
+                                         Ci.nsISupportsWeakReference]),
 
   _startListeners: function (windows) {
     for (let window of windows) {
       let docshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
                      .getInterface(Ci.nsIWebNavigation)
                      .QueryInterface(Ci.nsIDocShell);
       docshell.addWeakReflowObserver(this);
     }
--- a/devtools/server/actors/root.js
+++ b/devtools/server/actors/root.js
@@ -2,35 +2,35 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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/. */
 
 "use strict";
 
 const { Cc, Ci, Cu } = require("chrome");
-const Services = require("Services");
 const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common");
 const { DebuggerServer } = require("devtools/server/main");
 
 loader.lazyGetter(this, "ppmm", () => {
-  return Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(Ci.nsIMessageBroadcaster);
+  return Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(
+    Ci.nsIMessageBroadcaster);
 });
 
 /* Root actor for the remote debugging protocol. */
 
 /**
  * Create a remote debugging protocol root actor.
  *
- * @param aConnection
+ * @param connection
  *     The DebuggerServerConnection whose root actor we are constructing.
  *
- * @param aParameters
- *     The properties of |aParameters| provide backing objects for the root
- *     actor's requests; if a given property is omitted from |aParameters|, the
+ * @param parameters
+ *     The properties of |parameters| provide backing objects for the root
+ *     actor's requests; if a given property is omitted from |parameters|, the
  *     root actor won't implement the corresponding requests or notifications.
  *     Supported properties:
  *
  *     - tabList: a live list (see below) of tab actors. If present, the
  *       new root actor supports the 'listTabs' request, providing the live
  *       list's elements as its tab actors, and sending 'tabListChanged'
  *       notifications when the live list's contents change. One actor in
  *       this list must have a true '.selected' property.
@@ -84,23 +84,24 @@ loader.lazyGetter(this, "ppmm", () => {
  * live list implementations can use the state of the handler property (set
  * or null) to install and remove observers and event listeners.
  *
  * Note that, as the only way for the root actor to see the members of the
  * live list is to begin an iteration over the list, the live list need not
  * actually produce any actors until they are reached in the course of
  * iteration: alliterative lazy live lists.
  */
-function RootActor(aConnection, aParameters) {
-  this.conn = aConnection;
-  this._parameters = aParameters;
+function RootActor(connection, parameters) {
+  this.conn = connection;
+  this._parameters = parameters;
   this._onTabListChanged = this.onTabListChanged.bind(this);
   this._onAddonListChanged = this.onAddonListChanged.bind(this);
   this._onWorkerListChanged = this.onWorkerListChanged.bind(this);
-  this._onServiceWorkerRegistrationListChanged = this.onServiceWorkerRegistrationListChanged.bind(this);
+  this._onServiceWorkerRegistrationListChanged =
+    this.onServiceWorkerRegistrationListChanged.bind(this);
   this._onProcessListChanged = this.onProcessListChanged.bind(this);
   this._extraActors = {};
 
   this._globalActorPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._globalActorPool);
 
   this._chromeActor = null;
   this._processActors = new Map();
@@ -266,17 +267,18 @@ RootActor.prototype = {
         newActorPool.addActor(tabActor);
         tabActorList.push(tabActor);
       }
       /* DebuggerServer.addGlobalActor support: create actors. */
       if (!this._globalActorPool) {
         this._globalActorPool = new ActorPool(this.conn);
         this.conn.addActorPool(this._globalActorPool);
       }
-      this._createExtraActors(this._parameters.globalActorFactories, this._globalActorPool);
+      this._createExtraActors(this._parameters.globalActorFactories,
+        this._globalActorPool);
       /*
        * Drop the old actorID -> actor map. Actors that still mattered were
        * added to the new map; others will go away.
        */
       if (this._tabActorPool) {
         this.conn.removeActorPool(this._tabActorPool);
       }
       this._tabActorPool = newActorPool;
@@ -322,25 +324,26 @@ RootActor.prototype = {
                     tabActor.parentID = this.actorID;
                     this._tabActorPool.addActor(tabActor);
 
                     return { tab: tabActor.form() };
                   }, error => {
                     if (error.error) {
         // Pipe expected errors as-is to the client
                       return error;
-                    } else {
-                      return { error: "noTab",
-                 message: "Unexpected error while calling getTab(): " + error };
                     }
+                    return {
+                      error: "noTab",
+                      message: "Unexpected error while calling getTab(): " + error
+                    };
                   });
   },
 
   onTabListChanged: function () {
-    this.conn.send({ from: this.actorID, type:"tabListChanged" });
+    this.conn.send({ from: this.actorID, type: "tabListChanged" });
     /* It's a one-shot notification; no need to watch any more. */
     this._parameters.tabList.onListChanged = null;
   },
 
   onListAddons: function () {
     let addonList = this._parameters.addonList;
     if (!addonList) {
       return { from: this.actorID, error: "noAddons",
@@ -447,93 +450,92 @@ RootActor.prototype = {
     };
   },
 
   onProcessListChanged: function () {
     this.conn.send({ from: this.actorID, type: "processListChanged" });
     this._parameters.processList.onListChanged = null;
   },
 
-  onGetProcess: function (aRequest) {
+  onGetProcess: function (request) {
     if (!DebuggerServer.allowChromeProcess) {
       return { error: "forbidden",
                message: "You are not allowed to debug chrome." };
     }
-    if (("id" in aRequest) && typeof (aRequest.id) != "number") {
+    if (("id" in request) && typeof (request.id) != "number") {
       return { error: "wrongParameter",
                message: "getProcess requires a valid `id` attribute." };
     }
     // If the request doesn't contains id parameter or id is 0
     // (id == 0, based on onListProcesses implementation)
-    if ((!("id" in aRequest)) || aRequest.id === 0) {
+    if ((!("id" in request)) || request.id === 0) {
       if (!this._chromeActor) {
         // Create a ChromeActor for the parent process
         let { ChromeActor } = require("devtools/server/actors/chrome");
         this._chromeActor = new ChromeActor(this.conn);
         this._globalActorPool.addActor(this._chromeActor);
       }
 
       return { form: this._chromeActor.form() };
-    } else {
-      let { id } = aRequest;
-      let mm = ppmm.getChildAt(id);
-      if (!mm) {
-        return { error: "noProcess",
-                 message: "There is no process with id '" + id + "'." };
-      }
-      let form = this._processActors.get(id);
-      if (form) {
-        return { form };
-      }
-      let onDestroy = () => {
-        this._processActors.delete(id);
-      };
-      return DebuggerServer.connectToContent(this.conn, mm, onDestroy)
-        .then(form => {
-          this._processActors.set(id, form);
-          return { form };
-        });
+    }
+
+    let { id } = request;
+    let mm = ppmm.getChildAt(id);
+    if (!mm) {
+      return { error: "noProcess",
+               message: "There is no process with id '" + id + "'." };
     }
+    let form = this._processActors.get(id);
+    if (form) {
+      return { form };
+    }
+    let onDestroy = () => {
+      this._processActors.delete(id);
+    };
+    return DebuggerServer.connectToContent(this.conn, mm, onDestroy).then(formResult => {
+      this._processActors.set(id, formResult);
+      return { form: formResult };
+    });
   },
 
   /* This is not in the spec, but it's used by tests. */
-  onEcho: function (aRequest) {
+  onEcho: function (request) {
     /*
-     * Request packets are frozen. Copy aRequest, so that
+     * Request packets are frozen. Copy request, so that
      * DebuggerServerConnection.onPacket can attach a 'from' property.
      */
-    return Cu.cloneInto(aRequest, {});
+    return Cu.cloneInto(request, {});
   },
 
   onProtocolDescription: function () {
     return require("devtools/shared/protocol").dumpProtocolSpec();
   },
 
   /* Support for DebuggerServer.addGlobalActor. */
   _createExtraActors: createExtraActors,
   _appendExtraActors: appendExtraActors,
 
   /**
    * Remove the extra actor (added by DebuggerServer.addGlobalActor or
-   * DebuggerServer.addTabActor) name |aName|.
+   * DebuggerServer.addTabActor) name |name|.
    */
-  removeActorByName: function (aName) {
-    if (aName in this._extraActors) {
-      const actor = this._extraActors[aName];
+  removeActorByName: function (name) {
+    if (name in this._extraActors) {
+      const actor = this._extraActors[name];
       if (this._globalActorPool.has(actor)) {
         this._globalActorPool.removeActor(actor);
       }
       if (this._tabActorPool) {
         // Iterate over TabActor instances to also remove tab actors
         // created during listTabs for each document.
         this._tabActorPool.forEach(tab => {
-          tab.removeActorByName(aName);
+          tab.removeActorByName(name);
         });
       }
-      delete this._extraActors[aName];
+      delete this._extraActors[name];
     }
   }
 };
 
 RootActor.prototype.requestTypes = {
   "listTabs": RootActor.prototype.onListTabs,
   "getTab": RootActor.prototype.onGetTab,
   "listAddons": RootActor.prototype.onListAddons,
--- a/devtools/server/actors/settings.js
+++ b/devtools/server/actors/settings.js
@@ -33,17 +33,19 @@ function getDefaultSettings() {
                   .createInstance(Ci.nsIScriptableUnicodeConverter);
   converter.charset = "UTF-8";
   let rawstr = converter.ConvertToUnicode(NetUtil.readInputStreamToString(
                                           stream,
                                           stream.available()) || "");
 
   try {
     defaultSettings = JSON.parse(rawstr);
-  } catch (e) { }
+  } catch (e) {
+    // ignore
+  }
   stream.close();
 }
 
 function loadSettingsFile() {
   // Loading resource://app/defaults/settings.json doesn't work because
   // settings.json is not in the omnijar.
   // So we look for the app dir instead and go from here...
   if (settingsFile) {
@@ -110,17 +112,17 @@ var SettingsActor = exports.SettingsActo
     let settings = {};
     let self = this;
 
     let deferred = promise.defer();
     let lock = this._getSettingsService().createLock();
     let req = lock.get("*");
 
     req.onsuccess = function () {
-      for (var name in req.result) {
+      for (let name in req.result) {
         settings[name] = {
           value: req.result[name],
           hasUserValue: self._hasUserSetting(name, req.result[name])
         };
       }
       deferred.resolve(settings);
     };
     req.onfailure = function () {
--- a/devtools/server/actors/source.js
+++ b/devtools/server/actors/source.js
@@ -6,22 +6,21 @@
 
 "use strict";
 
 const { Cc, Ci } = require("chrome");
 const Services = require("Services");
 const { BreakpointActor, setBreakpointAtEntryPoints } = require("devtools/server/actors/breakpoint");
 const { OriginalLocation, GeneratedLocation } = require("devtools/server/actors/common");
 const { createValueGrip } = require("devtools/server/actors/object");
-const { ActorClassWithSpec, Arg, RetVal, method } = require("devtools/shared/protocol");
+const { ActorClassWithSpec } = require("devtools/shared/protocol");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const { assert, fetch } = DevToolsUtils;
 const { joinURI } = require("devtools/shared/path");
 const promise = require("promise");
-const { defer, resolve, reject, all } = promise;
 const { sourceSpec } = require("devtools/shared/specs/source");
 
 loader.lazyRequireGetter(this, "SourceMapConsumer", "source-map", true);
 loader.lazyRequireGetter(this, "SourceMapGenerator", "source-map", true);
 loader.lazyRequireGetter(this, "mapURIToAddonID", "devtools/server/actors/utils/map-uri-to-addon-id");
 
 function isEvalSource(source) {
   let introType = source.introductionType;
@@ -39,68 +38,65 @@ exports.isEvalSource = isEvalSource;
 function getSourceURL(source, window) {
   if (isEvalSource(source)) {
     // Eval sources have no urls, but they might have a `displayURL`
     // created with the sourceURL pragma. If the introduction script
     // is a non-eval script, generate an full absolute URL relative to it.
 
     if (source.displayURL && source.introductionScript &&
        !isEvalSource(source.introductionScript.source)) {
-
       if (source.introductionScript.source.url === "debugger eval code") {
         if (window) {
           // If this is a named eval script created from the console, make it
           // relative to the current page. window is only available
           // when we care about this.
           return joinURI(window.location.href, source.displayURL);
         }
-      }
-      else {
+      } else {
         return joinURI(source.introductionScript.source.url, source.displayURL);
       }
     }
 
     return source.displayURL;
-  }
-  else if (source.url === "debugger eval code") {
+  } else if (source.url === "debugger eval code") {
     // Treat code evaluated by the console as unnamed eval scripts
     return null;
   }
   return source.url;
 }
 
 exports.getSourceURL = getSourceURL;
 
 /**
  * Resolve a URI back to physical file.
  *
  * Of course, this works only for URIs pointing to local resources.
  *
- * @param  aURI
+ * @param  uri
  *         URI to resolve
  * @return
  *         resolved nsIURI
  */
-function resolveURIToLocalPath(aURI) {
+function resolveURIToLocalPath(uri) {
   let resolved;
-  switch (aURI.scheme) {
+  switch (uri.scheme) {
     case "jar":
     case "file":
-      return aURI;
+      return uri;
 
     case "chrome":
-      resolved = Cc["@mozilla.org/chrome/chrome-registry;1"].
-                 getService(Ci.nsIChromeRegistry).convertChromeURL(aURI);
+      resolved = Cc["@mozilla.org/chrome/chrome-registry;1"]
+                  .getService(Ci.nsIChromeRegistry).convertChromeURL(uri);
       return resolveURIToLocalPath(resolved);
 
     case "resource":
-      resolved = Cc["@mozilla.org/network/protocol;1?name=resource"].
-                 getService(Ci.nsIResProtocolHandler).resolveURI(aURI);
-      aURI = Services.io.newURI(resolved);
-      return resolveURIToLocalPath(aURI);
+      resolved = Cc["@mozilla.org/network/protocol;1?name=resource"]
+                  .getService(Ci.nsIResProtocolHandler).resolveURI(uri);
+      uri = Services.io.newURI(resolved);
+      return resolveURIToLocalPath(uri);
 
     default:
       return null;
   }
 }
 
 /**
  * A SourceActor provides information about the source of a script. There
@@ -177,30 +173,46 @@ let SourceActor = ActorClassWithSpec(sou
         this.threadActor.sources.isPrettyPrinted(this.url)
     ));
   },
 
   get isInlineSource() {
     return this._isInlineSource;
   },
 
-  get threadActor() { return this._threadActor; },
-  get sources() { return this._threadActor.sources; },
-  get dbg() { return this.threadActor.dbg; },
-  get source() { return this._source; },
-  get generatedSource() { return this._generatedSource; },
-  get breakpointActorMap() { return this.threadActor.breakpointActorMap; },
+  get threadActor() {
+    return this._threadActor;
+  },
+  get sources() {
+    return this._threadActor.sources;
+  },
+  get dbg() {
+    return this.threadActor.dbg;
+  },
+  get source() {
+    return this._source;
+  },
+  get generatedSource() {
+    return this._generatedSource;
+  },
+  get breakpointActorMap() {
+    return this.threadActor.breakpointActorMap;
+  },
   get url() {
     if (this.source) {
       return getSourceURL(this.source, this.threadActor._parent.window);
     }
     return this._originalUrl;
   },
-  get addonID() { return this._addonID; },
-  get addonPath() { return this._addonPath; },
+  get addonID() {
+    return this._addonID;
+  },
+  get addonPath() {
+    return this._addonPath;
+  },
 
   get prettyPrintWorker() {
     return this.threadActor.prettyPrintWorker;
   },
 
   form: function () {
     let source = this.source || this.generatedSource;
     // This might not have a source or a generatedSource because we
@@ -228,20 +240,20 @@ let SourceActor = ActorClassWithSpec(sou
 
   destroy: function () {
     if (this.registeredPool && this.registeredPool.sourceActors) {
       delete this.registeredPool.sourceActors[this.actorID];
     }
   },
 
   _mapSourceToAddon: function () {
+    let nsuri;
     try {
-      var nsuri = Services.io.newURI(this.url.split(" -> ").pop());
-    }
-    catch (e) {
+      nsuri = Services.io.newURI(this.url.split(" -> ").pop());
+    } catch (e) {
       // We can't do anything with an invalid URI
       return;
     }
 
     let localURI = resolveURIToLocalPath(nsuri);
     if (!localURI) {
       return;
     }
@@ -250,18 +262,17 @@ let SourceActor = ActorClassWithSpec(sou
     if (!id) {
       return;
     }
     this._addonID = id;
 
     if (localURI instanceof Ci.nsIJARURI) {
       // The path in the add-on is easy for jar: uris
       this._addonPath = localURI.JAREntry;
-    }
-    else if (localURI instanceof Ci.nsIFileURL) {
+    } else if (localURI instanceof Ci.nsIFileURL) {
       // For file: uris walk up to find the last directory that is part of the
       // add-on
       let target = localURI.file;
       let path = target.leafName;
 
       // We can assume that the directory containing the source file is part
       // of the add-on
       let root = target.parent;
@@ -305,17 +316,19 @@ let SourceActor = ActorClassWithSpec(sou
       console.error("\t", "source map's sourcesContent =");
       map.sourcesContent.forEach(c => {
         if (c.length > 80) {
           c = c.slice(0, 77) + "...";
         }
         c = c.replace(/\n/g, "\\n");
         console.error("\t\t", c);
       });
-    } catch (e) { }
+    } catch (e) {
+      // ignore
+    }
   },
 
   _getSourceText: function () {
     let toResolvedContent = t => ({
       content: t,
       contentType: this._contentType
     });
 
@@ -341,63 +354,62 @@ let SourceActor = ActorClassWithSpec(sou
       // sources to get the contentType from the headers.
       if (this.source &&
           this.source.text !== "[no source]" &&
           this._contentType &&
           (this._contentType.indexOf("javascript") !== -1 ||
            this._contentType === "text/wasm")) {
         return toResolvedContent(this.source.text);
       }
-      else {
-        // Only load the HTML page source from cache (which exists when
-        // there are inline sources). Otherwise, we can't trust the
-        // cache because we are most likely here because we are
-        // fetching the original text for sourcemapped code, and the
-        // page hasn't requested it before (if it has, it was a
-        // previous debugging session).
-        let loadFromCache = this.isInlineSource;
+
+      // Only load the HTML page source from cache (which exists when
+      // there are inline sources). Otherwise, we can't trust the
+      // cache because we are most likely here because we are
+      // fetching the original text for sourcemapped code, and the
+      // page hasn't requested it before (if it has, it was a
+      // previous debugging session).
+      let loadFromCache = this.isInlineSource;
 
-        // Fetch the sources with the same principal as the original document
-        let win = this.threadActor._parent.window;
-        let principal, cacheKey;
-        // On xpcshell, we don't have a window but a Sandbox
-        if (!isWorker && win instanceof Ci.nsIDOMWindow) {
-          let webNav = win.QueryInterface(Ci.nsIInterfaceRequestor)
-                          .getInterface(Ci.nsIWebNavigation);
-          let channel = webNav.currentDocumentChannel;
-          principal = channel.loadInfo.loadingPrincipal;
+      // Fetch the sources with the same principal as the original document
+      let win = this.threadActor._parent.window;
+      let principal, cacheKey;
+      // On xpcshell, we don't have a window but a Sandbox
+      if (!isWorker && win instanceof Ci.nsIDOMWindow) {
+        let webNav = win.QueryInterface(Ci.nsIInterfaceRequestor)
+                        .getInterface(Ci.nsIWebNavigation);
+        let channel = webNav.currentDocumentChannel;
+        principal = channel.loadInfo.loadingPrincipal;
 
-          // Retrieve the cacheKey in order to load POST requests from cache
-          // Note that chrome:// URLs don't support this interface.
-          if (loadFromCache &&
-            webNav.currentDocumentChannel instanceof Ci.nsICacheInfoChannel) {
-            cacheKey = webNav.currentDocumentChannel.cacheKey;
-            assert(
-              cacheKey,
-              "Could not fetch the cacheKey from the related document."
-            );
-          }
+        // Retrieve the cacheKey in order to load POST requests from cache
+        // Note that chrome:// URLs don't support this interface.
+        if (loadFromCache &&
+          webNav.currentDocumentChannel instanceof Ci.nsICacheInfoChannel) {
+          cacheKey = webNav.currentDocumentChannel.cacheKey;
+          assert(
+            cacheKey,
+            "Could not fetch the cacheKey from the related document."
+          );
         }
+      }
 
-        let sourceFetched = fetch(this.url, {
-          principal,
-          cacheKey,
-          loadFromCache
-        });
+      let sourceFetched = fetch(this.url, {
+        principal,
+        cacheKey,
+        loadFromCache
+      });
 
-        // Record the contentType we just learned during fetching
-        return sourceFetched
-          .then(result => {
-            this._contentType = result.contentType;
-            return result;
-          }, error => {
-            this._reportLoadSourceError(error, map);
-            throw error;
-          });
-      }
+      // Record the contentType we just learned during fetching
+      return sourceFetched
+        .then(result => {
+          this._contentType = result.contentType;
+          return result;
+        }, error => {
+          this._reportLoadSourceError(error, map);
+          throw error;
+        });
     });
   },
 
   /**
    * Get all executable lines from the current source
    * @return Array - Executable lines of the current script
    **/
   getExecutableLines: function () {
@@ -451,29 +463,29 @@ let SourceActor = ActorClassWithSpec(sou
 
     return offsets;
   },
 
   /**
    * Handler for the "source" packet.
    */
   onSource: function () {
-    return resolve(this._init)
+    return promise.resolve(this._init)
       .then(this._getSourceText)
       .then(({ content, contentType }) => {
         return {
           source: createValueGrip(content, this.threadActor.threadLifetimePool,
             this.threadActor.objectGrip),
           contentType: contentType
         };
       })
-      .then(null, aError => {
-        reportError(aError, "Got an exception during SA_onSource: ");
+      .then(null, error => {
+        reportError(error, "Got an exception during SA_onSource: ");
         throw new Error("Could not load the source for " + this.url + ".\n" +
-                        DevToolsUtils.safeErrorString(aError));
+                        DevToolsUtils.safeErrorString(error));
       });
   },
 
   /**
    * Handler for the "prettyPrint" packet.
    */
   prettyPrint: function (indent) {
     this.threadActor.sources.prettyPrint(this.url, indent);
@@ -493,29 +505,29 @@ let SourceActor = ActorClassWithSpec(sou
         throw new Error(DevToolsUtils.safeErrorString(error));
       });
   },
 
   /**
    * Return a function that sends a request to the pretty print worker, waits on
    * the worker's response, and then returns the pretty printed code.
    *
-   * @param Number aIndent
+   * @param Number indent
    *        The number of spaces to indent by the code by, when we send the
    *        request to the pretty print worker.
    * @returns Function
    *          Returns a function which takes an AST, and returns a promise that
    *          is resolved with `{ code, mappings }` where `code` is the pretty
    *          printed code, and `mappings` is an array of source mappings.
    */
-  _sendToPrettyPrintWorker: function (aIndent) {
+  _sendToPrettyPrintWorker: function (indent) {
     return ({ content }) => {
       return this.prettyPrintWorker.performTask("pretty-print", {
         url: this.url,
-        indent: aIndent,
+        indent,
         source: content
       });
     };
   },
 
   /**
    * Invert a source map. So if a source map maps from a to b, return a new
    * source map from b to a. We need to do this because the source map we get
@@ -571,29 +583,28 @@ let SourceActor = ActorClassWithSpec(sou
           map: prevMap
         };
 
         prevMap = SourceMapGenerator.fromSourceMap(prevMap);
         prevMap.applySourceMap(sm, this.url);
         sm = SourceMapConsumer.fromSourceMap(prevMap);
       }
 
-      let sources = this.threadActor.sources;
-      sources.clearSourceMapCache(source.sourceMapURL);
-      sources.setSourceMapHard(source, null, sm);
+      let actorSources = this.threadActor.sources;
+      actorSources.clearSourceMapCache(source.sourceMapURL);
+      actorSources.setSourceMapHard(source, null, sm);
     });
   },
 
   /**
    * Handler for the "disablePrettyPrint" packet.
    */
   disablePrettyPrint: function () {
     let source = this.generatedSource || this.source;
     let sources = this.threadActor.sources;
-    let sm = sources.getSourceMap(source);
 
     sources.clearSourceMapCache(source.sourceMapURL, { hard: true });
 
     if (this._oldSourceMapping) {
       sources.setSourceMapHard(source,
                                this._oldSourceMapping.url,
                                this._oldSourceMapping.map);
       this._oldSourceMapping = null;
@@ -636,20 +647,21 @@ let SourceActor = ActorClassWithSpec(sou
    *        If true, disables breakpoint sliding.
    *
    * @returns Promise
    *          A promise that resolves to a JSON object representing the
    *          response.
    */
   setBreakpoint: function (line, column, condition, noSliding) {
     if (this.threadActor.state !== "paused") {
-      throw {
+      let errorObject = {
         error: "wrongState",
         message: "Cannot set breakpoint while debuggee is running."
       };
+      throw errorObject;
     }
 
     let location = new OriginalLocation(this, line, column);
     return this._getOrCreateBreakpointActor(
       location,
       condition,
       noSliding
     ).then((actor) => {
@@ -758,21 +770,21 @@ let SourceActor = ActorClassWithSpec(sou
         // GCed as well, and no scripts will exist on those lines
         // anymore. We will never slide through a GCed script.
         if (originalLocation.originalColumn || scripts.length === 0) {
           return promise.resolve(actor);
         }
 
         // Find the script that spans the largest amount of code to
         // determine the bounds for sliding.
-        const largestScript = scripts.reduce((largestScript, script) => {
-          if (script.lineCount > largestScript.lineCount) {
+        const largestScript = scripts.reduce((largestScr, script) => {
+          if (script.lineCount > largestScr.lineCount) {
             return script;
           }
-          return largestScript;
+          return largestScr;
         });
         const maxLine = largestScript.startLine + largestScript.lineCount - 1;
 
         let actualLine = originalLine;
         for (; actualLine <= maxLine; actualLine++) {
           const loc = new GeneratedLocation(this, actualLine);
           if (this._setBreakpointAtGeneratedLocation(actor, loc)) {
             break;
@@ -800,26 +812,26 @@ let SourceActor = ActorClassWithSpec(sou
           actor = existingActor;
         } else {
           actor.originalLocation = actualLocation;
           this.breakpointActorMap.setActor(actualLocation, actor);
         }
       }
 
       return promise.resolve(actor);
-    } else {
-      return this.sources.getAllGeneratedLocations(originalLocation).then((generatedLocations) => {
+    }
+    return this.sources.getAllGeneratedLocations(originalLocation)
+      .then((generatedLocations) => {
         this._setBreakpointAtAllGeneratedLocations(
           actor,
           generatedLocations
         );
 
         return actor;
       });
-    }
   },
 
   _setBreakpointAtAllGeneratedLocations: function (actor, generatedLocations) {
     let success = false;
     for (let generatedLocation of generatedLocations) {
       if (this._setBreakpointAtGeneratedLocation(
         actor,
         generatedLocation
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -1482,17 +1482,17 @@ function DatabaseMetadata(origin, db, st
 
   if (db.objectStoreNames.length) {
     let transaction = db.transaction(db.objectStoreNames, "readonly");
 
     for (let i = 0; i < transaction.objectStoreNames.length; i++) {
       let objectStore =
         transaction.objectStore(transaction.objectStoreNames[i]);
       this._objectStores.push([transaction.objectStoreNames[i],
-                              new ObjectStoreMetadata(objectStore)]);
+                               new ObjectStoreMetadata(objectStore)]);
     }
   }
 }
 DatabaseMetadata.prototype = {
   get objectStores() {
     return this._objectStores;
   },
 
@@ -1919,17 +1919,17 @@ var indexedDBHelpers = {
    * database `name`.
    */
   openWithPrincipal: function (principal, name, storage) {
     return indexedDBForStorage.openForPrincipal(principal, name,
                                                 { storage: storage });
   },
 
   removeDB: Task.async(function* (host, principal, dbName) {
-    let result = new promise(resolve => {
+    let result = new Promise(resolve => {
       let {name, storage} = this.splitNameAndStorage(dbName);
       let request =
         indexedDBForStorage.deleteForPrincipal(principal, name,
                                                { storage: storage });
 
       request.onsuccess = () => {
         resolve({});
         this.onItemUpdated("deleted", host, [dbName]);
@@ -1956,26 +1956,26 @@ var indexedDBHelpers = {
     return this.backToChild("removeDB", yield result);
   }),
 
   removeDBRecord: Task.async(function* (host, principal, dbName, storeName, id) {
     let db;
     let {name, storage} = this.splitNameAndStorage(dbName);
 
     try {
-      db = yield new promise((resolve, reject) => {
+      db = yield new Promise((resolve, reject) => {
         let request = this.openWithPrincipal(principal, name, storage);
         request.onsuccess = ev => resolve(ev.target.result);
         request.onerror = ev => reject(ev.target.error);
       });
 
       let transaction = db.transaction(storeName, "readwrite");
       let store = transaction.objectStore(storeName);
 
-      yield new promise((resolve, reject) => {
+      yield new Promise((resolve, reject) => {
         let request = store.delete(id);
         request.onsuccess = () => resolve();
         request.onerror = ev => reject(ev.target.error);
       });
 
       this.onItemUpdated("deleted", host, [dbName, storeName, id]);
     } catch (error) {
       let recordPath = [dbName, storeName, id].join("/");
@@ -1989,26 +1989,26 @@ var indexedDBHelpers = {
     return this.backToChild("removeDBRecord", null);
   }),
 
   clearDBStore: Task.async(function* (host, principal, dbName, storeName) {
     let db;
     let {name, storage} = this.splitNameAndStorage(dbName);
 
     try {
-      db = yield new promise((resolve, reject) => {
+      db = yield new Promise((resolve, reject) => {
         let request = this.openWithPrincipal(principal, name, storage);
         request.onsuccess = ev => resolve(ev.target.result);
         request.onerror = ev => reject(ev.target.error);
       });
 
       let transaction = db.transaction(storeName, "readwrite");
       let store = transaction.objectStore(storeName);
 
-      yield new promise((resolve, reject) => {
+      yield new Promise((resolve, reject) => {
         let request = store.clear();
         request.onsuccess = () => resolve();
         request.onerror = ev => reject(ev.target.error);
       });
 
       this.onItemUpdated("cleared", host, [dbName, storeName]);
     } catch (error) {
       let storePath = [dbName, storeName].join("/");
--- a/devtools/server/actors/timeline.js
+++ b/devtools/server/actors/timeline.js
@@ -21,17 +21,17 @@ const { Option, RetVal } = protocol;
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
 const { Timeline } = require("devtools/server/performance/timeline");
 const { timelineSpec } = require("devtools/shared/specs/timeline");
 const events = require("sdk/event/core");
 
 /**
  * The timeline actor pops and forwards timeline markers registered in docshells.
  */
-var TimelineActor = exports.TimelineActor = protocol.ActorClassWithSpec(timelineSpec, {
+exports.TimelineActor = protocol.ActorClassWithSpec(timelineSpec, {
   /**
    * Initializes this actor with the provided connection and tab actor.
    */
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this.bridge = new Timeline(tabActor);
 
--- a/devtools/server/actors/utils/map-uri-to-addon-id.js
+++ b/devtools/server/actors/utils/map-uri-to-addon-id.js
@@ -19,20 +19,18 @@ const GRAPHENE_ID = "{d1bfe7d9-c01e-4237
 /**
  * This is a wrapper around amIAddonPathService.mapURIToAddonID which always returns
  * false on B2G and graphene to avoid loading the add-on manager there and
  * reports any exceptions rather than throwing so that the caller doesn't have
  * to worry about them.
  */
 if (!Services.appinfo
     || Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT
-
     /* XPCShell */
     || Services.appinfo.ID === undefined
-
     || Services.appinfo.ID == B2G_ID
     || Services.appinfo.ID == GRAPHENE_ID
     || !AddonPathService) {
   module.exports = function mapURIToAddonId(uri) {
     return false;
   };
 } else {
   module.exports = function mapURIToAddonId(uri) {
--- a/devtools/server/actors/utils/webconsole-listeners.js
+++ b/devtools/server/actors/utils/webconsole-listeners.js
@@ -31,17 +31,18 @@ XPCOMUtils.defineLazyServiceGetter(this,
  *        the nsIConsoleMessage, whenever a relevant message is received.
  */
 function ConsoleServiceListener(window, listener) {
   this.window = window;
   this.listener = listener;
 }
 exports.ConsoleServiceListener = ConsoleServiceListener;
 
-ConsoleServiceListener.prototype = {
+ConsoleServiceListener.prototype =
+{
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIConsoleListener]),
 
   /**
    * The content window for which we listen to page errors.
    * @type nsIDOMWindow
    */
   window: null,
 
@@ -195,17 +196,18 @@ ConsoleServiceListener.prototype = {
  */
 function ConsoleAPIListener(window, owner, {addonId} = {}) {
   this.window = window;
   this.owner = owner;
   this.addonId = addonId;
 }
 exports.ConsoleAPIListener = ConsoleAPIListener;
 
-ConsoleAPIListener.prototype = {
+ConsoleAPIListener.prototype =
+{
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
   /**
    * The content window for which we listen to window.console API calls.
    * @type nsIDOMWindow
    */
   window: null,
 
@@ -382,17 +384,18 @@ function ConsoleReflowListener(window, l
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShell);
   this.listener = listener;
   this.docshell.addWeakReflowObserver(this);
 }
 
 exports.ConsoleReflowListener = ConsoleReflowListener;
 
-ConsoleReflowListener.prototype = {
+ConsoleReflowListener.prototype =
+{
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
                                          Ci.nsISupportsWeakReference]),
   docshell: null,
   listener: null,
 
   /**
    * Forward reflow event to listener.
    *
--- a/devtools/server/actors/webaudio.js
+++ b/devtools/server/actors/webaudio.js
@@ -1,33 +1,27 @@
 /* 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/. */
 "use strict";
 
-const {Cc, Ci, Cu, Cr} = require("chrome");
+/* global XPCNativeWrapper */
 
-const Services = require("Services");
+const { Cu } = require("chrome");
 
 const events = require("sdk/event/core");
-const promise = require("promise");
 const { on: systemOn, off: systemOff } = require("sdk/system/events");
 const protocol = require("devtools/shared/protocol");
 const { CallWatcherActor } = require("devtools/server/actors/call-watcher");
-const { CallWatcherFront } = require("devtools/shared/fronts/call-watcher");
 const { createValueGrip } = require("devtools/server/actors/object");
 const AutomationTimeline = require("./utils/automation-timeline");
-const { on, once, off, emit } = events;
-const { types, method, Arg, Option, RetVal, preEvent } = protocol;
+const { on, off, emit } = events;
 const {
   audionodeSpec,
-  webAudioSpec,
-  AUTOMATION_METHODS,
-  NODE_CREATION_METHODS,
-  NODE_ROUTING_METHODS,
+  webAudioSpec
 } = require("devtools/shared/specs/webaudio");
 const { WebAudioFront } = require("devtools/shared/fronts/webaudio");
 const AUDIO_NODE_DEFINITION = require("devtools/server/actors/utils/audionodes.json");
 const ENABLE_AUTOMATION = false;
 const AUTOMATION_GRANULARITY = 2000;
 const AUTOMATION_GRANULARITY_MAX = 6000;
 
 const AUDIO_GLOBALS = [
@@ -40,17 +34,18 @@ const AUDIO_GLOBALS = [
  */
 var AudioNodeActor = exports.AudioNodeActor = protocol.ActorClassWithSpec(audionodeSpec, {
   form: function (detail) {
     if (detail === "actorid") {
       return this.actorID;
     }
 
     return {
-      actor: this.actorID, // actorID is set when this is added to a pool
+      // actorID is set when this is added to a pool
+      actor: this.actorID,
       type: this.type,
       source: this.source,
       bypassable: this.bypassable,
     };
   },
 
   /**
    * Create the Audio Node actor.
@@ -112,29 +107,29 @@ var AudioNodeActor = exports.AudioNodeAc
 
     // Cast to boolean incase `passThrough` is undefined,
     // like for AudioDestinationNode
     return !!node.passThrough;
   },
 
   /**
    * Takes a boolean, either enabling or disabling the "passThrough" option
-   * on an AudioNode. If a node is bypassed, an effects processing node (like gain, biquad),
-   * will allow the audio stream to pass through the node, unaffected. Returns
-   * the bypass state of the node.
+   * on an AudioNode. If a node is bypassed, an effects processing node (like gain,
+   * biquad), will allow the audio stream to pass through the node, unaffected.
+   * Returns the bypass state of the node.
    *
    * @param Boolean enable
    *        Whether the bypass value should be set on or off.
    * @return Boolean
    */
   bypass: function (enable) {
     let node = this.node.get();
 
     if (node === null) {
-      return;
+      return undefined;
     }
 
     if (this.bypassable) {
       node.passThrough = enable;
     }
 
     return this.isBypassed();
   },
@@ -154,18 +149,17 @@ var AudioNodeActor = exports.AudioNodeAc
     if (node === null) {
       return CollectedAudioNodeError();
     }
 
     try {
       if (isAudioParam(node, param)) {
         node[param].value = value;
         this.automation[param].setValue(value);
-      }
-      else {
+      } else {
         node[param] = value;
       }
       return undefined;
     } catch (e) {
       return constructError(e);
     }
   },
 
@@ -234,16 +228,17 @@ var AudioNodeActor = exports.AudioNodeAc
       // patched method that fires the webaudio actor's `connect-param` event.
       // Connect directly to the wrapped `destNode`, otherwise
       // the patched method thinks this is a new node and won't be
       // able to find it in `_nativeToActorID`.
       XPCNativeWrapper.unwrap(srcNode).connect(destNode[paramName], output);
     } catch (e) {
       return constructError(e);
     }
+    return undefined;
   },
 
   /**
    * Connects this audionode to another via `node.connect(dest)`.
    */
   connectNode: function (destActor, output, input) {
     let srcNode = this.node.get();
     let destNode = destActor.node.get();
@@ -257,16 +252,17 @@ var AudioNodeActor = exports.AudioNodeAc
       // patched method that fires the webaudio actor's `connect-node` event.
       // Connect directly to the wrapped `destNode`, otherwise
       // the patched method thinks this is a new node and won't be
       // able to find it in `_nativeToActorID`.
       XPCNativeWrapper.unwrap(srcNode).connect(destNode, output, input);
     } catch (e) {
       return constructError(e);
     }
+    return undefined;
   },
 
   /**
    * Disconnects this audionode from all connections via `node.disconnect()`.
    */
   disconnect: function (destActor, output) {
     let node = this.node.get();
 
@@ -276,34 +272,34 @@ var AudioNodeActor = exports.AudioNodeAc
 
     try {
       // Disconnect via the unwrapped node, so we can call the
       // patched method that fires the webaudio actor's `disconnect` event.
       XPCNativeWrapper.unwrap(node).disconnect(output);
     } catch (e) {
       return constructError(e);
     }
+    return undefined;
   },
 
   getAutomationData: function (paramName) {
     let timeline = this.automation[paramName];
     if (!timeline) {
       return null;
     }
 
-    let events = timeline.events;
     let values = [];
     let i = 0;
 
     if (!timeline.events.length) {
-      return { events, values };
+      return { events: timeline.events, values };
     }
 
-    let firstEvent = events[0];
-    let lastEvent = events[timeline.events.length - 1];
+    let firstEvent = timeline.events[0];
+    let lastEvent = timeline.events[timeline.events.length - 1];
     // `setValueCurveAtTime` will have a duration value -- other
     // events will have duration of `0`.
     let timeDelta = (lastEvent.time + lastEvent.duration) - firstEvent.time;
     let scale = timeDelta / AUTOMATION_GRANULARITY;
 
     for (; i < AUTOMATION_GRANULARITY; i++) {
       let delta = firstEvent.time + (i * scale);
       let value = timeline.getValueAtTime(delta);
@@ -317,17 +313,17 @@ var AudioNodeActor = exports.AudioNodeAc
     if (lastEvent.type === "setTargetAtTime") {
       for (; i < AUTOMATION_GRANULARITY_MAX; i++) {
         let delta = firstEvent.time + (++i * scale);
         let value = timeline.getValueAtTime(delta);
         values.push({ delta, value });
       }
     }
 
-    return { events, values };
+    return { events: timeline.events, values };
   },
 
   /**
    * Called via WebAudioActor, registers an automation event
    * for the AudioParam called.
    *
    * @param String paramName
    *        Name of the AudioParam.
@@ -373,16 +369,17 @@ var AudioNodeActor = exports.AudioNodeAc
 
       // Apply the args back from the content scope, which is necessary
       // due to the method wrapping changing in bug 1130901 to be exported
       // directly to the content scope.
       param[eventName].apply(param, contentArgs);
     } catch (e) {
       return constructError(e);
     }
+    return undefined;
   },
 
   /**
    * Registers the automation event in the AudioNodeActor's
    * internal timeline. Called when setting automation via
    * `addAutomationEvent`, or from the WebAudioActor's listening
    * to the event firing via content.
    *
@@ -399,17 +396,17 @@ var AudioNodeActor = exports.AudioNodeAc
   }
 });
 
 /**
  * The Web Audio Actor handles simple interaction with an BaseAudioContext
  * high-level methods. After instantiating this actor, you'll need to set it
  * up by calling setup().
  */
-var WebAudioActor = exports.WebAudioActor = protocol.ActorClassWithSpec(webAudioSpec, {
+exports.WebAudioActor = protocol.ActorClassWithSpec(webAudioSpec, {
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
 
     this._onContentFunctionCall = this._onContentFunctionCall.bind(this);
 
     // Store ChromeOnly ID (`nativeID` property on AudioNodeActor) mapped
     // to the associated actorID, so we don't have to expose `nativeID`
@@ -482,41 +479,37 @@ var WebAudioActor = exports.WebAudioActo
    */
   _onContentFunctionCall: function (functionCall) {
     let { name } = functionCall.details;
 
     // All Web Audio nodes inherit from AudioNode's prototype, so
     // hook into the `connect` and `disconnect` methods
     if (WebAudioFront.NODE_ROUTING_METHODS.has(name)) {
       this._handleRoutingCall(functionCall);
-    }
-    else if (WebAudioFront.NODE_CREATION_METHODS.has(name)) {
+    } else if (WebAudioFront.NODE_CREATION_METHODS.has(name)) {
       this._handleCreationCall(functionCall);
-    }
-    else if (ENABLE_AUTOMATION && WebAudioFront.AUTOMATION_METHODS.has(name)) {
+    } else if (ENABLE_AUTOMATION && WebAudioFront.AUTOMATION_METHODS.has(name)) {
       this._handleAutomationCall(functionCall);
     }
   },
 
   _handleRoutingCall: function (functionCall) {
     let { caller, args, name } = functionCall.details;
     let source = caller;
     let dest = args[0];
-    let isAudioParam = dest ? getConstructorName(dest) === "AudioParam" : false;
+    let isAudioPar = dest ? getConstructorName(dest) === "AudioParam" : false;
 
     // audionode.connect(param)
-    if (name === "connect" && isAudioParam) {
+    if (name === "connect" && isAudioPar) {
       this._onConnectParam(source, dest);
-    }
-    // audionode.connect(node)
-    else if (name === "connect") {
+    } else if (name === "connect") {
+      // audionode.connect(node)
       this._onConnectNode(source, dest);
-    }
-    // audionode.disconnect()
-    else if (name === "disconnect") {
+    } else if (name === "disconnect") {
+      // audionode.disconnect()
       this._onDisconnectNode(source);
     }
   },
 
   _handleCreationCall: function (functionCall) {
     let { caller, result } = functionCall.details;
     // Keep track of the first node created, so we can alert
     // the front end that an audio context is being used since
@@ -822,17 +815,18 @@ function createObjectGrip(value) {
 }
 
 /**
  * Converts all TypedArrays of the array that cannot
  * be passed over the wire into a normal Array equivilent.
  */
 function sanitizeAutomationArgs(args) {
   return args.reduce((newArgs, el) => {
-    newArgs.push(typeof el === "object" && getConstructorName(el) === "Float32Array" ? castToArray(el) : el);
+    let isArray = typeof el === "object" && getConstructorName(el) === "Float32Array";
+    newArgs.push(isArray ? castToArray(el) : el);
     return newArgs;
   }, []);
 }
 
 /**
  * Casts TypedArray to a normal array via a
  * new scope.
  */
--- a/devtools/server/actors/webgl.js
+++ b/devtools/server/actors/webgl.js
@@ -1,20 +1,21 @@
 /* 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/. */
 "use strict";
 
-const {Cc, Ci, Cu, Cr} = require("chrome");
+/* global XPCNativeWrapper */
+
+const {Cu} = require("chrome");
 const events = require("sdk/event/core");
 const promise = require("promise");
 const protocol = require("devtools/shared/protocol");
 const { ContentObserver } = require("devtools/shared/content-observer");
-const { on, once, off, emit } = events;
-const { method, Arg, Option, RetVal } = protocol;
+const { on, off, emit } = events;
 const {
   shaderSpec,
   programSpec,
   webGLSpec,
 } = require("devtools/shared/specs/webgl");
 
 const WEBGL_CONTEXT_NAMES = ["webgl", "experimental-webgl", "moz-webgl"];
 
@@ -170,26 +171,27 @@ var ProgramActor = protocol.ActorClassWi
    */
   _getShaderActor: function (type) {
     if (this._shaderActorsCache[type]) {
       return this._shaderActorsCache[type];
     }
     let proxy = this.linkedProxy;
     let shader = proxy.getShaderOfType(this.shaders, type);
     let shaderActor = new ShaderActor(this.conn, this.program, shader, proxy);
-    return this._shaderActorsCache[type] = shaderActor;
+    this._shaderActorsCache[type] = shaderActor;
+    return this._shaderActorsCache[type];
   }
 });
 
 /**
  * The WebGL Actor handles simple interaction with a WebGL context via a few
  * high-level methods. After instantiating this actor, you'll need to set it
  * up by calling setup().
  */
-var WebGLActor = exports.WebGLActor = protocol.ActorClassWithSpec(webGLSpec, {
+exports.WebGLActor = protocol.ActorClassWithSpec(webGLSpec, {
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this._onGlobalCreated = this._onGlobalCreated.bind(this);
     this._onGlobalDestroyed = this._onGlobalDestroyed.bind(this);
     this._onProgramLinked = this._onProgramLinked.bind(this);
   },
   destroy: function (conn) {
@@ -264,44 +266,46 @@ var WebGLActor = exports.WebGLActor = pr
   /**
    * Gets a pixel's RGBA value from a context specified by selector
    * and the coordinates of the pixel in question.
    * Currently only used in tests.
    *
    * @param string selector
    *        A string selector to select the canvas in question from the DOM.
    * @param Object position
-   *        An object with an `x` and `y` property indicating coordinates of the pixel being inspected.
+   *        An object with an `x` and `y` property indicating coordinates of
+   *        the pixel being inspected.
    * @return Object
    *        An object containing `r`, `g`, `b`, and `a` properties of the pixel.
    */
   getPixel: function ({ selector, position }) {
     let { x, y } = position;
     let canvas = this.tabActor.window.document.querySelector(selector);
     let context = XPCNativeWrapper.unwrap(canvas.getContext("webgl"));
     let { proxy } = this._webglObserver.for(context);
     let height = canvas.height;
 
     let buffer = new this.tabActor.window.Uint8Array(4);
     buffer = XPCNativeWrapper.unwrap(buffer);
 
-    proxy.readPixels(x, height - y - 1, 1, 1, context.RGBA, context.UNSIGNED_BYTE, buffer);
+    proxy.readPixels(
+      x, height - y - 1, 1, 1, context.RGBA, context.UNSIGNED_BYTE, buffer
+    );
 
     return { r: buffer[0], g: buffer[1], b: buffer[2], a: buffer[3] };
   },
 
   /**
    * Gets an array of all cached program actors belonging to all windows.
    * This should only be used for tests.
    */
   _getAllPrograms: function () {
     return this._programActorsCache;
   },
 
-
   /**
    * Invoked whenever the current tab actor's document global is created.
    */
   _onGlobalCreated: function ({id, window, isTopLevel}) {
     if (isTopLevel) {
       WebGLInstrumenter.handle(window, this._webglObserver);
       events.emit(this, "global-created", id);
     }
@@ -407,79 +411,89 @@ var WebGLInstrumenter = {
     let { cache, proxy } = observer.for(context);
     let originalFunc = context[funcName];
     let beforeFuncName = callbackName[0] || funcName;
     let afterFuncName = callbackName[1] || callbackName[0] || funcName;
 
     context[funcName] = function (...glArgs) {
       if (timing <= 0 && !observer.suppressHandlers) {
         let glBreak = observer[beforeFuncName](glArgs, cache, proxy);
-        if (glBreak) return undefined;
+        if (glBreak) {
+          return undefined;
+        }
       }
 
       // Invoking .apply on an unxrayed content function doesn't work, because
       // the arguments array is inaccessible to it. Get Xrays back.
       let glResult = Cu.waiveXrays(Cu.unwaiveXrays(originalFunc).apply(this, glArgs));
 
       if (timing >= 0 && !observer.suppressHandlers) {
         let glBreak = observer[afterFuncName](glArgs, glResult, cache, proxy);
-        if (glBreak) return undefined;
+        if (glBreak) {
+          return undefined;
+        }
       }
 
       return glResult;
     };
   },
 
   /**
    * Override mappings for WebGL methods.
    */
   _methods: [{
-    timing: 1, // after
+    // after
+    timing: 1,
     functions: [
       "linkProgram", "getAttribLocation", "getUniformLocation"
     ]
   }, {
-    timing: -1, // before
+    // before
+    timing: -1,
     callback: [
       "toggleVertexAttribArray"
     ],
     functions: [
       "enableVertexAttribArray", "disableVertexAttribArray"
     ]
   }, {
-    timing: -1, // before
+    // before
+    timing: -1,
     callback: [
       "attribute_"
     ],
     functions: [
       "vertexAttrib1f", "vertexAttrib2f", "vertexAttrib3f", "vertexAttrib4f",
       "vertexAttrib1fv", "vertexAttrib2fv", "vertexAttrib3fv", "vertexAttrib4fv",
       "vertexAttribPointer"
     ]
   }, {
-    timing: -1, // before
+    // before
+    timing: -1,
     callback: [
       "uniform_"
     ],
     functions: [
       "uniform1i", "uniform2i", "uniform3i", "uniform4i",
       "uniform1f", "uniform2f", "uniform3f", "uniform4f",
       "uniform1iv", "uniform2iv", "uniform3iv", "uniform4iv",
       "uniform1fv", "uniform2fv", "uniform3fv", "uniform4fv",
       "uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv"
     ]
   }, {
-    timing: -1, // before
+    // before
+    timing: -1,
     functions: [
       "useProgram", "enable", "disable", "blendColor",
       "blendEquation", "blendEquationSeparate",
       "blendFunc", "blendFuncSeparate"
     ]
   }, {
-    timing: 0, // before and after
+    // before and after
+    timing: 0,
     callback: [
       "beforeDraw_", "afterDraw_"
     ],
     functions: [
       "drawArrays", "drawElements"
     ]
   }]
   // TODO: It'd be a good idea to handle other functions as well:
@@ -609,43 +623,46 @@ WebGLObserver.prototype = {
    *
    * @param array glArgs
    *        Overridable arguments with which the function is called.
    * @param WebGLCache cache
    *        The state storage for the WebGL context initiating this call.
    */
   toggleVertexAttribArray: function (glArgs, cache) {
     glArgs[0] = cache.getCurrentAttributeLocation(glArgs[0]);
-    return glArgs[0] < 0; // Return true to break original function call.
+    // Return true to break original function call.
+    return glArgs[0] < 0;
   },
 
   /**
    * Called immediately *before* 'attribute_' is requested in the context.
    *
    * @param array glArgs
    *        Overridable arguments with which the function is called.
    * @param WebGLCache cache
    *        The state storage for the WebGL context initiating this call.
    */
   attribute_: function (glArgs, cache) {
     glArgs[0] = cache.getCurrentAttributeLocation(glArgs[0]);
-    return glArgs[0] < 0; // Return true to break original function call.
+    // Return true to break original function call.
+    return glArgs[0] < 0;
   },
 
   /**
    * Called immediately *before* 'uniform_' is requested in the context.
    *
    * @param array glArgs
    *        Overridable arguments with which the function is called.
    * @param WebGLCache cache
    *        The state storage for the WebGL context initiating this call.
    */
   uniform_: function (glArgs, cache) {
     glArgs[0] = cache.getCurrentUniformLocation(glArgs[0]);
-    return !glArgs[0]; // Return true to break original function call.
+    // Return true to break original function call.
+    return !glArgs[0];
   },
 
   /**
    * Called immediately *before* 'useProgram' is requested in the context.
    *
    * @param array glArgs
    *        Overridable arguments with which the function is called.
    * @param WebGLCache cache
@@ -765,17 +782,18 @@ WebGLObserver.prototype = {
    * @param WebGLProxy proxy
    *        The proxy methods for the WebGL context initiating this call.
    */
   beforeDraw_: function (glArgs, cache, proxy) {
     let traits = cache.currentProgramTraits;
 
     // Handle program blackboxing.
     if (traits & PROGRAM_BLACKBOX_TRAIT) {
-      return true; // Return true to break original function call.
+      // Return true to break original function call.
+      return true;
     }
     // Handle program highlighting.
     if (traits & PROGRAM_HIGHLIGHT_TRAIT) {
       proxy.enableHighlighting();
     }
 
     return false;
   },
@@ -870,18 +888,20 @@ WebGLCache.prototype = {
    * @param WebGLProgram program
    *        The shader for which the traits are to be cached.
    * @param number traits
    *        A default properties mask set for the program.
    */
   addProgram: function (program, traits) {
     this._programs.set(program, {
       traits: traits,
-      attributes: [], // keys are GLints (numbers)
-      uniforms: new Map() // keys are WebGLUniformLocations (objects)
+      // keys are GLints (numbers)
+      attributes: [],
+      // keys are WebGLUniformLocations (objects)
+      uniforms: new Map()
     });
   },
 
   /**
    * Adds a specific trait to a program. The effect of such properties is
    * determined by the consumer of this cache.
    *
    * @param WebGLProgram program
@@ -1054,17 +1074,19 @@ function WebGLProxy(id, context, cache, 
     "getAttachedShaders",
     "getShaderSource",
     "getShaderOfType",
     "compileShader",
     "enableHighlighting",
     "disableHighlighting",
     "readPixels"
   ];
-  exports.forEach(e => this[e] = (...args) => this._call(e, args));
+  exports.forEach(e => {
+    this[e] = (...args) => this._call(e, args);
+  });
 }
 
 WebGLProxy.prototype = {
   _id: 0,
   _gl: null,
   _cache: null,
   _observer: null,
 
@@ -1123,17 +1145,17 @@ WebGLProxy.prototype = {
    * @param string type
    *        The framebuffer object attachment point, for example "COLOR_ATTACHMENT0".
    * @param string name
    *        The WebGL parameter name, for example "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME".
    *        If unspecified, defaults to "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE".
    * @return any
    *         The corresponding parameter's value.
    */
-  _getFramebufferAttachmentParameter: function (type, name = "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE") {
+  _getFramebufferAttachmentParameter(type, name = "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE") {
     if (!this._getParameter("FRAMEBUFFER_BINDING")) {
       return null;
     }
     let gl = this._gl;
     return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl[type], gl[name]);
   },
 
   /**
--- a/devtools/server/actors/worker.js
+++ b/devtools/server/actors/worker.js
@@ -166,17 +166,19 @@ let WorkerActor = protocol.ActorClassWit
       this._threadActor = null;
     }
 
     // If the worker is already destroyed, nsIWorkerDebugger.type throws
     // (_dbg.closed appears to be false when it throws)
     let type;
     try {
       type = this._dbg.type;
-    } catch (e) {}
+    } catch (e) {
+      // nothing
+    }
 
     if (type == Ci.nsIWorkerDebugger.TYPE_SERVICE) {
       let worker = this._getServiceWorkerInfo();
       if (worker) {
         worker.detachDebugger();
       }
     }