Bug 1452575 - Automatically fix ESLint issues in shared jsm files in devtools. r?jryans draft
authorMark Banner <standard8@mozilla.com>
Mon, 09 Apr 2018 10:44:03 +0100
changeset 779593 c016619dd495a64e561b6f831da8fb0d92b502ae
parent 779502 83de58ddda2057f1cb949537f6b111e3b115ea3d
child 779594 29503d06086608b754810b4af28f48e4584f3238
push id105819
push userbmo:standard8@mozilla.com
push dateTue, 10 Apr 2018 09:15:25 +0000
reviewersjryans
bugs1452575
milestone61.0a1
Bug 1452575 - Automatically fix ESLint issues in shared jsm files in devtools. r?jryans MozReview-Commit-ID: 422ylOOSZUx
devtools/client/shared/AppCacheUtils.jsm
devtools/client/shared/DOMHelpers.jsm
devtools/client/shared/SplitView.jsm
devtools/client/shared/widgets/AbstractTreeItem.jsm
devtools/client/shared/widgets/BreadcrumbsWidget.jsm
devtools/client/shared/widgets/SideMenuWidget.jsm
devtools/client/shared/widgets/SimpleListWidget.jsm
devtools/client/shared/widgets/VariablesView.jsm
devtools/client/shared/widgets/VariablesViewController.jsm
--- a/devtools/client/shared/AppCacheUtils.jsm
+++ b/devtools/client/shared/AppCacheUtils.jsm
@@ -63,17 +63,17 @@ AppCacheUtils.prototype = {
         if (!this.manifestURI) {
           this._addError(0, "noManifest");
           resolve(this.errors);
         }
 
         this._getURIInfo(this.manifestURI).then(uriInfo => {
           this._parseManifest(uriInfo).then(() => {
             // Sort errors by line number.
-            this.errors.sort(function (a, b) {
+            this.errors.sort(function(a, b) {
               return a.line - b.line;
             });
             resolve(this.errors);
           });
         });
       });
     });
   },
@@ -190,22 +190,22 @@ AppCacheUtils.prototype = {
         securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
       });
 
       // Avoid the cache:
       channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
       channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
 
       channel.asyncOpen2({
-        onStartRequest: function (request, context) {
+        onStartRequest: function(request, context) {
           // This empty method is needed in order for onDataAvailable to be
           // called.
         },
 
-        onDataAvailable: function (request, context, stream, offset, count) {
+        onDataAvailable: function(request, context, stream, offset, count) {
           request.QueryInterface(Ci.nsIHttpChannel);
           inputStream.init(stream);
           buffer = buffer.concat(inputStream.read(count));
         },
 
         onStopRequest: function onStartRequest(request, context, statusCode) {
           if (statusCode === 0) {
             request.QueryInterface(Ci.nsIHttpChannel);
@@ -218,22 +218,22 @@ AppCacheUtils.prototype = {
               mimeType: request.contentType,
               contentLength: request.contentLength,
               nocache: request.isNoCacheResponse() || request.isNoStoreResponse(),
               prePath: request.URI.prePath + "/",
               text: buffer
             };
 
             result.requestHeaders = {};
-            request.visitRequestHeaders(function (header, value) {
+            request.visitRequestHeaders(function(header, value) {
               result.requestHeaders[header.toLowerCase()] = value;
             });
 
             result.responseHeaders = {};
-            request.visitResponseHeaders(function (header, value) {
+            request.visitResponseHeaders(function(header, value) {
               result.responseHeaders[header.toLowerCase()] = value;
             });
 
             resolve(result);
           } else {
             resolve({
               name: request.name,
               success: false
@@ -248,19 +248,19 @@ AppCacheUtils.prototype = {
     if (!Services.prefs.getBoolPref("browser.cache.disk.enable")) {
       throw new Error(l10n.GetStringFromName("cacheDisabled"));
     }
 
     let entries = [];
 
     let appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
     appCacheStorage.asyncVisitStorage({
-      onCacheStorageInfo: function () {},
+      onCacheStorageInfo: function() {},
 
-      onCacheEntryInfo: function (aURI, aIdEnhance, aDataSize, aFetchCount, aLastModifiedTime, aExpirationTime) {
+      onCacheEntryInfo: function(aURI, aIdEnhance, aDataSize, aFetchCount, aLastModifiedTime, aExpirationTime) {
         let lowerKey = aURI.asciiSpec.toLowerCase();
 
         if (searchTerm && !lowerKey.includes(searchTerm.toLowerCase())) {
           return;
         }
 
         if (aIdEnhance) {
           aIdEnhance += ":";
@@ -297,17 +297,17 @@ AppCacheUtils.prototype = {
 
   clearAll: function ACU_clearAll() {
     if (!Services.prefs.getBoolPref("browser.cache.disk.enable")) {
       throw new Error(l10n.GetStringFromName("cacheDisabled"));
     }
 
     let appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
     appCacheStorage.asyncEvictStorage({
-      onCacheEntryDoomed: function (result) {}
+      onCacheEntryDoomed: function(result) {}
     });
   },
 
   _getManifestURI: function ACU__getManifestURI() {
     return new Promise((resolve, reject) => {
       let getURI = () => {
         let htmlNode = this.doc.querySelector("html[manifest]");
         if (htmlNode) {
@@ -323,32 +323,31 @@ AppCacheUtils.prototype = {
 
           return pageUri.substring(0, pageUri.lastIndexOf("/") + 1) + manifestURI;
         }
       };
 
       if (this.doc) {
         let uri = getURI();
         return resolve(uri);
-      } else {
-        this._getURIInfo(this.uri).then(uriInfo => {
-          if (uriInfo.success) {
-            let html = uriInfo.text;
-            let parser = _DOMParser;
-            this.doc = parser.parseFromString(html, "text/html");
-            let uri = getURI();
-            resolve(uri);
-          } else {
-            this.errors.push({
+      }
+      this._getURIInfo(this.uri).then(uriInfo => {
+        if (uriInfo.success) {
+          let html = uriInfo.text;
+          let parser = _DOMParser;
+          this.doc = parser.parseFromString(html, "text/html");
+          let uri = getURI();
+          resolve(uri);
+        } else {
+          this.errors.push({
               line: 0,
               msg: l10n.GetStringFromName("invalidURI")
-            });
-          }
-        });
-      }
+          });
+        }
+      });
     });
   },
 
   _addError: function ACU__addError(line, l10nString, ...params) {
     let msg;
 
     if (params) {
       msg = l10n.formatStringFromName(l10nString, params, params.length);
@@ -610,17 +609,16 @@ ManifestParser.prototype = {
       }
     }
   },
 };
 
 XPCOMUtils.defineLazyGetter(this, "l10n", () => Services.strings
   .createBundle("chrome://devtools/locale/appcacheutils.properties"));
 
-XPCOMUtils.defineLazyGetter(this, "appcacheservice", function () {
+XPCOMUtils.defineLazyGetter(this, "appcacheservice", function() {
   return Cc["@mozilla.org/network/application-cache-service;1"]
            .getService(Ci.nsIApplicationCacheService);
-
 });
 
-XPCOMUtils.defineLazyGetter(this, "_DOMParser", function () {
+XPCOMUtils.defineLazyGetter(this, "_DOMParser", function() {
   return Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser);
 });
--- a/devtools/client/shared/DOMHelpers.jsm
+++ b/devtools/client/shared/DOMHelpers.jsm
@@ -21,117 +21,119 @@ this.EXPORTED_SYMBOLS = ["DOMHelpers"];
 this.DOMHelpers = function DOMHelpers(aWindow) {
   if (!aWindow) {
     throw new Error("window can't be null or undefined");
   }
   this.window = aWindow;
 };
 
 DOMHelpers.prototype = {
-  getParentObject: function Helpers_getParentObject(node)
-  {
+  getParentObject: function Helpers_getParentObject(node) {
     let parentNode = node ? node.parentNode : null;
 
     if (!parentNode) {
       // Documents have no parentNode; Attr, Document, DocumentFragment, Entity,
       // and Notation. top level windows have no parentNode
       if (node && node == this.window.Node.DOCUMENT_NODE) {
         // document type
         if (node.defaultView) {
           let embeddingFrame = node.defaultView.frameElement;
-          if (embeddingFrame)
+          if (embeddingFrame) {
             return embeddingFrame.parentNode;
+          }
         }
       }
       // a Document object without a parentNode or window
-      return null;  // top level has no parent
+      return null; // top level has no parent
     }
 
     if (parentNode.nodeType == this.window.Node.DOCUMENT_NODE) {
       if (parentNode.defaultView) {
         return parentNode.defaultView.frameElement;
       }
       // parent is document element, but no window at defaultView.
       return null;
     }
 
-    if (!parentNode.localName)
+    if (!parentNode.localName) {
       return null;
+    }
 
     return parentNode;
   },
 
   getChildObject: function Helpers_getChildObject(node, index, previousSibling,
-                                                showTextNodesWithWhitespace)
-  {
-    if (!node)
+                                                showTextNodesWithWhitespace) {
+    if (!node) {
       return null;
+    }
 
     if (node.contentDocument) {
       // then the node is a frame
       if (index == 0) {
-        return node.contentDocument.documentElement;  // the node's HTMLElement
+        return node.contentDocument.documentElement; // the node's HTMLElement
       }
       return null;
     }
 
     if (node.getSVGDocument) {
       let svgDocument = node.getSVGDocument();
       if (svgDocument) {
         // then the node is a frame
         if (index == 0) {
-          return svgDocument.documentElement;  // the node's SVGElement
+          return svgDocument.documentElement; // the node's SVGElement
         }
         return null;
       }
     }
 
     let child = null;
-    if (previousSibling)  // then we are walking
+    if (previousSibling) // then we are walking
+      {
       child = this.getNextSibling(previousSibling);
-    else
+    } else {
       child = this.getFirstChild(node);
+    }
 
-    if (showTextNodesWithWhitespace)
+    if (showTextNodesWithWhitespace) {
       return child;
+    }
 
     for (; child; child = this.getNextSibling(child)) {
-      if (!this.isWhitespaceText(child))
+      if (!this.isWhitespaceText(child)) {
         return child;
+      }
     }
 
-    return null;  // we have no children worth showing.
+    return null; // we have no children worth showing.
   },
 
-  getFirstChild: function Helpers_getFirstChild(node)
-  {
+  getFirstChild: function Helpers_getFirstChild(node) {
     let SHOW_ALL = nodeFilterConstants.SHOW_ALL;
     this.treeWalker = node.ownerDocument.createTreeWalker(node,
       SHOW_ALL, null);
     return this.treeWalker.firstChild();
   },
 
-  getNextSibling: function Helpers_getNextSibling(node)
-  {
+  getNextSibling: function Helpers_getNextSibling(node) {
     let next = this.treeWalker.nextSibling();
 
-    if (!next)
+    if (!next) {
       delete this.treeWalker;
+    }
 
     return next;
   },
 
-  isWhitespaceText: function Helpers_isWhitespaceText(node)
-  {
+  isWhitespaceText: function Helpers_isWhitespaceText(node) {
     return node.nodeType == this.window.Node.TEXT_NODE &&
                             !/[^\s]/.exec(node.nodeValue);
   },
 
-  destroy: function Helpers_destroy()
-  {
+  destroy: function Helpers_destroy() {
     delete this.window;
     delete this.treeWalker;
   },
 
   /**
    * A simple way to be notified (once) when a window becomes
    * interactive (DOMContentLoaded).
    *
@@ -139,17 +141,17 @@ DOMHelpers.prototype = {
    * chrome iframes are loaded in content docshells (in Firefox
    * tabs for example).
    */
   onceDOMReady: function Helpers_onLocationChange(callback, targetURL) {
     let window = this.window;
     let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShell);
-    let onReady = function (event) {
+    let onReady = function(event) {
       if (event.target == window.document) {
         docShell.chromeEventHandler.removeEventListener("DOMContentLoaded", onReady);
         // If in `callback` the URL of the window is changed and a listener to DOMContentLoaded
         // is attached, the event we just received will be also be caught by the new listener.
         // We want to avoid that so we execute the callback in the next queue.
         Services.tm.dispatchToMainThread(callback);
       }
     };
--- a/devtools/client/shared/SplitView.jsm
+++ b/devtools/client/shared/SplitView.jsm
@@ -23,18 +23,17 @@ var bindings = new WeakMap();
  * A split view contains items, each of those having one summary and one details
  * elements.
  * It is adaptive as it behaves similarly to a richlistbox when there the aspect
  * ratio is narrow or as a pair listbox-box otherwise.
  *
  * @param DOMElement aRoot
  * @see appendItem
  */
-this.SplitView = function SplitView(aRoot)
-{
+this.SplitView = function SplitView(aRoot) {
   this._root = aRoot;
   this._controller = aRoot.querySelector(".splitview-controller");
   this._nav = aRoot.querySelector(".splitview-nav");
   this._side = aRoot.querySelector(".splitview-side-details");
   this._activeSummary = null;
 
   this._mql = aRoot.ownerDocument.defaultView.matchMedia(LANDSCAPE_MEDIA_QUERY);
 
@@ -84,48 +83,44 @@ this.SplitView = function SplitView(aRoo
 };
 
 SplitView.prototype = {
   /**
     * Retrieve whether the UI currently has a landscape orientation.
     *
     * @return boolean
     */
-  get isLandscape()
-  {
+  get isLandscape() {
     return this._mql.matches;
   },
 
   /**
     * Retrieve the root element.
     *
     * @return DOMElement
     */
-  get rootElement()
-  {
+  get rootElement() {
     return this._root;
   },
 
   /**
     * Retrieve the active item's summary element or null if there is none.
     *
     * @return DOMElement
     */
-  get activeSummary()
-  {
+  get activeSummary() {
     return this._activeSummary;
   },
 
   /**
     * Set the active item's summary element.
     *
     * @param DOMElement aSummary
     */
-  set activeSummary(aSummary)
-  {
+  set activeSummary(aSummary) {
     if (aSummary == this._activeSummary) {
       return;
     }
 
     if (this._activeSummary) {
       let binding = bindings.get(this._activeSummary);
 
       if (binding.onHide) {
@@ -150,32 +145,30 @@ SplitView.prototype = {
       binding.onShow(aSummary, binding._details, binding.data);
     }
   },
 
   /**
     * Retrieve the active item's details element or null if there is none.
     * @return DOMElement
     */
-  get activeDetails()
-  {
+  get activeDetails() {
     let summary = this.activeSummary;
     return summary ? bindings.get(summary)._details : null;
   },
 
   /**
    * Retrieve the summary element for a given ordinal.
    *
    * @param number aOrdinal
    * @return DOMElement
    *         Summary element with given ordinal or null if not found.
    * @see appendItem
    */
-  getSummaryElementByOrdinal: function SEC_getSummaryElementByOrdinal(aOrdinal)
-  {
+  getSummaryElementByOrdinal: function SEC_getSummaryElementByOrdinal(aOrdinal) {
     return this._nav.querySelector("* > li[data-ordinal='" + aOrdinal + "']");
   },
 
   /**
    * Append an item to the split view.
    *
    * @param DOMElement aSummary
    *        The summary element for the item.
@@ -193,18 +186,17 @@ SplitView.prototype = {
    *     - function(summary, details, data) onDestroy
    *         Called when the item has been removed.
    *     - object data
    *         Object to pass to the callbacks above.
    *     - number ordinal
    *         Items with a lower ordinal are displayed before those with a
    *         higher ordinal.
    */
-  appendItem: function ASV_appendItem(aSummary, aDetails, aOptions)
-  {
+  appendItem: function ASV_appendItem(aSummary, aDetails, aOptions) {
     let binding = aOptions || {};
 
     binding._summary = aSummary;
     binding._details = aDetails;
     bindings.set(aSummary, binding);
 
     this._nav.appendChild(aSummary);
 
@@ -230,18 +222,17 @@ SplitView.prototype = {
    *        and "splitview-tpl-details-" suffixed with aName.
    * @param object aOptions
    *        Optional object that defines custom behavior and data for the item.
    *        See appendItem for full description.
    * @return object{summary:,details:}
    *         Object with the new DOM elements created for summary and details.
    * @see appendItem
    */
-  appendTemplatedItem: function ASV_appendTemplatedItem(aName, aOptions)
-  {
+  appendTemplatedItem: function ASV_appendTemplatedItem(aName, aOptions) {
     aOptions = aOptions || {};
     let summary = this._root.querySelector("#splitview-tpl-summary-" + aName);
     let details = this._root.querySelector("#splitview-tpl-details-" + aName);
 
     summary = summary.cloneNode(true);
     summary.id = "";
     if (aOptions.ordinal !== undefined) { // can be zero
       summary.style.MozBoxOrdinalGroup = aOptions.ordinal;
@@ -255,53 +246,50 @@ SplitView.prototype = {
   },
 
   /**
     * Remove an item from the split view.
     *
     * @param DOMElement aSummary
     *        Summary element of the item to remove.
     */
-  removeItem: function ASV_removeItem(aSummary)
-  {
+  removeItem: function ASV_removeItem(aSummary) {
     if (aSummary == this._activeSummary) {
       this.activeSummary = null;
     }
 
     let binding = bindings.get(aSummary);
     aSummary.remove();
     binding._details.remove();
 
     if (binding.onDestroy) {
       binding.onDestroy(aSummary, binding._details, binding.data);
     }
   },
 
   /**
    * Remove all items from the split view.
    */
-  removeAll: function ASV_removeAll()
-  {
+  removeAll: function ASV_removeAll() {
     while (this._nav.hasChildNodes()) {
       this.removeItem(this._nav.firstChild);
     }
   },
 
   /**
    * Set the item's CSS class name.
    * This sets the class on both the summary and details elements, retaining
    * any SplitView-specific classes.
    *
    * @param DOMElement aSummary
    *        Summary element of the item to set.
    * @param string aClassName
    *        One or more space-separated CSS classes.
    */
-  setItemClassName: function ASV_setItemClassName(aSummary, aClassName)
-  {
+  setItemClassName: function ASV_setItemClassName(aSummary, aClassName) {
     let binding = bindings.get(aSummary);
     let viewSpecific;
 
     viewSpecific = aSummary.className.match(/(splitview\-[\w-]+)/g);
     viewSpecific = viewSpecific ? viewSpecific.join(" ") : "";
     aSummary.className = viewSpecific + " " + aClassName;
 
     viewSpecific = binding._details.className.match(/(splitview\-[\w-]+)/g);
--- a/devtools/client/shared/widgets/AbstractTreeItem.jsm
+++ b/devtools/client/shared/widgets/AbstractTreeItem.jsm
@@ -144,30 +144,30 @@ AbstractTreeItem.prototype = {
    * Creates the view for this tree item. Implement this method in the
    * inheriting classes to create the child node displayed in the tree.
    * Use `this.level` and the provided `arrowNode` as you see fit.
    *
    * @param nsIDOMNode document
    * @param nsIDOMNode arrowNode
    * @return nsIDOMNode
    */
-  _displaySelf: function (document, arrowNode) {
+  _displaySelf: function(document, arrowNode) {
     throw new Error(
       "The `_displaySelf` method needs to be implemented by inheriting classes.");
   },
 
   /**
    * Populates this tree item with child items, whenever it's expanded.
    * Implement this method in the inheriting classes to fill the provided
    * `children` array with AbstractTreeItem instances, which will then be
    * magically handled by this tree item.
    *
    * @param array:AbstractTreeItem children
    */
-  _populateSelf: function (children) {
+  _populateSelf: function(children) {
     throw new Error(
       "The `_populateSelf` method needs to be implemented by inheriting classes.");
   },
 
   /**
    * Gets the this tree's owner document.
    * @return Document
    */
@@ -247,17 +247,17 @@ AbstractTreeItem.prototype = {
    * @param nsIDOMNode containerNode
    *        The parent element for this tree item (and every other tree item).
    * @param nsIDOMNode fragmentNode [optional]
    *        An optional document fragment temporarily holding this tree item in
    *        the current batch. Defaults to the `containerNode`.
    * @param nsIDOMNode beforeNode [optional]
    *        An optional child element which should succeed this tree item.
    */
-  attachTo: function (containerNode, fragmentNode = containerNode, beforeNode = null) {
+  attachTo: function(containerNode, fragmentNode = containerNode, beforeNode = null) {
     this._containerNode = containerNode;
     this._constructTargetNode();
 
     if (beforeNode) {
       fragmentNode.insertBefore(this._targetNode, beforeNode);
     } else {
       fragmentNode.appendChild(this._targetNode);
     }
@@ -266,178 +266,178 @@ AbstractTreeItem.prototype = {
       this.expand();
     }
   },
 
   /**
    * Permanently removes this tree item (and all subsequent children) from the
    * parent container.
    */
-  remove: function () {
+  remove: function() {
     this._targetNode.remove();
     this._hideChildren();
     this._childTreeItems.length = 0;
   },
 
   /**
    * Focuses this item in the tree.
    */
-  focus: function () {
+  focus: function() {
     this._targetNode.focus();
   },
 
   /**
    * Expands this item in the tree.
    */
-  expand: function () {
+  expand: function() {
     if (this._expanded) {
       return;
     }
     this._expanded = true;
     this._arrowNode.setAttribute("open", "");
     this._targetNode.setAttribute("expanded", "");
     this._toggleChildren(true);
     this._rootItem.emit("expand", this);
   },
 
   /**
    * Collapses this item in the tree.
    */
-  collapse: function () {
+  collapse: function() {
     if (!this._expanded) {
       return;
     }
     this._expanded = false;
     this._arrowNode.removeAttribute("open");
     this._targetNode.removeAttribute("expanded", "");
     this._toggleChildren(false);
     this._rootItem.emit("collapse", this);
   },
 
   /**
    * Returns the child item at the specified index.
    *
    * @param number index
    * @return AbstractTreeItem
    */
-  getChild: function (index = 0) {
+  getChild: function(index = 0) {
     return this._childTreeItems[index];
   },
 
   /**
    * Calls the provided function on all the descendants of this item.
    * If this item was never expanded, then no descendents exist yet.
    * @param function cb
    */
-  traverse: function (cb) {
+  traverse: function(cb) {
     for (let child of this._childTreeItems) {
       cb(child);
       child.bfs();
     }
   },
 
   /**
    * Calls the provided function on all descendants of this item until
    * a truthy value is returned by the predicate.
    * @param function predicate
    * @return AbstractTreeItem
    */
-  find: function (predicate) {
+  find: function(predicate) {
     for (let child of this._childTreeItems) {
       if (predicate(child) || child.find(predicate)) {
         return child;
       }
     }
     return null;
   },
 
   /**
    * Shows or hides all the children of this item in the tree. If neessary,
    * populates this item with children.
    *
    * @param boolean visible
    *        True if the children should be visible, false otherwise.
    */
-  _toggleChildren: function (visible) {
+  _toggleChildren: function(visible) {
     if (visible) {
       if (!this._populated) {
         this._populateSelf(this._childTreeItems);
         this._populated = this._childTreeItems.length > 0;
       }
       this._showChildren();
     } else {
       this._hideChildren();
     }
   },
 
   /**
    * Shows all children of this item in the tree.
    */
-  _showChildren: function () {
+  _showChildren: function() {
     // If this is the root item and we're not expanding any child nodes,
     // it is safe to append everything at once.
     if (this == this._rootItem && this.autoExpandDepth == 0) {
       this._appendChildrenBatch();
     }
     // Otherwise, append the child items and their descendants successively;
     // if not, the tree will become garbled and nodes will intertwine,
     // since all the tree items are sharing a single container node.
     else {
       this._appendChildrenSuccessive();
     }
   },
 
   /**
    * Hides all children of this item in the tree.
    */
-  _hideChildren: function () {
+  _hideChildren: function() {
     for (let item of this._childTreeItems) {
       item._targetNode.remove();
       item._hideChildren();
     }
   },
 
   /**
    * Appends all children in a single batch.
    * This only works properly for root nodes when no child nodes will expand.
    */
-  _appendChildrenBatch: function () {
+  _appendChildrenBatch: function() {
     if (this._fragment === undefined) {
       this._fragment = this.document.createDocumentFragment();
     }
 
     let childTreeItems = this._childTreeItems;
 
     for (let i = 0, len = childTreeItems.length; i < len; i++) {
       childTreeItems[i].attachTo(this._containerNode, this._fragment);
     }
 
     this._containerNode.appendChild(this._fragment);
   },
 
   /**
    * Appends all children successively.
    */
-  _appendChildrenSuccessive: function () {
+  _appendChildrenSuccessive: function() {
     let childTreeItems = this._childTreeItems;
     let expandedChildTreeItems = childTreeItems.filter(e => e._expanded);
     let nextNode = this._getSiblingAtDelta(1);
 
     for (let i = 0, len = childTreeItems.length; i < len; i++) {
       childTreeItems[i].attachTo(this._containerNode, undefined, nextNode);
     }
     for (let i = 0, len = expandedChildTreeItems.length; i < len; i++) {
       expandedChildTreeItems[i]._showChildren();
     }
   },
 
   /**
    * Constructs and stores the target node displaying this tree item.
    */
-  _constructTargetNode: function () {
+  _constructTargetNode: function() {
     if (this._constructed) {
       return;
     }
     this._onArrowClick = this._onArrowClick.bind(this);
     this._onClick = this._onClick.bind(this);
     this._onDoubleClick = this._onDoubleClick.bind(this);
     this._onKeyDown = this._onKeyDown.bind(this);
     this._onFocus = this._onFocus.bind(this);
@@ -465,17 +465,17 @@ AbstractTreeItem.prototype = {
    * Gets the element displaying an item in the tree at the specified offset
    * relative to this item.
    *
    * @param number delta
    *        The offset from this item to the target item.
    * @return nsIDOMNode
    *         The element displaying the target item at the specified offset.
    */
-  _getSiblingAtDelta: function (delta) {
+  _getSiblingAtDelta: function(delta) {
     let childNodes = this._containerNode.childNodes;
     let indexOfSelf = Array.indexOf(childNodes, this._targetNode);
     if (indexOfSelf + delta >= 0) {
       return childNodes[indexOfSelf + delta];
     }
     return undefined;
   },
 
@@ -491,99 +491,105 @@ AbstractTreeItem.prototype = {
     let utils = win.QueryInterface(Ci.nsIInterfaceRequestor)
                    .getInterface(Ci.nsIDOMWindowUtils);
     return utils.getBoundsWithoutFlushing(elem).height;
   },
 
   /**
    * Focuses the first item in this tree.
    */
-  _focusFirstNode: function () {
+  _focusFirstNode: function() {
     let childNodes = this._containerNode.childNodes;
     // The root node of the tree may be hidden in practice, so uses for-loop
     // here to find the next visible node.
     for (let i = 0; i < childNodes.length; i++) {
       // The height will be 0 if an element is invisible.
       if (this._getHeight(childNodes[i])) {
         childNodes[i].focus();
         return;
       }
     }
   },
 
   /**
    * Focuses the last item in this tree.
    */
-  _focusLastNode: function () {
+  _focusLastNode: function() {
     let childNodes = this._containerNode.childNodes;
     childNodes[childNodes.length - 1].focus();
   },
 
   /**
    * Focuses the next item in this tree.
    */
-  _focusNextNode: function () {
+  _focusNextNode: function() {
     let nextElement = this._getSiblingAtDelta(1);
-    if (nextElement) nextElement.focus(); // nsIDOMNode
+    if (nextElement) {
+      nextElement.focus();
+    } // nsIDOMNode
   },
 
   /**
    * Focuses the previous item in this tree.
    */
-  _focusPrevNode: function () {
+  _focusPrevNode: function() {
     let prevElement = this._getSiblingAtDelta(-1);
-    if (prevElement) prevElement.focus(); // nsIDOMNode
+    if (prevElement) {
+      prevElement.focus();
+    } // nsIDOMNode
   },
 
   /**
    * Focuses the parent item in this tree.
    *
    * The parent item is not always the previous item, because any tree item
    * may have multiple children.
    */
-  _focusParentNode: function () {
+  _focusParentNode: function() {
     let parentItem = this._parentItem;
-    if (parentItem) parentItem.focus(); // AbstractTreeItem
+    if (parentItem) {
+      parentItem.focus();
+    } // AbstractTreeItem
   },
 
   /**
    * Handler for the "click" event on the arrow node of this tree item.
    */
-  _onArrowClick: function (e) {
+  _onArrowClick: function(e) {
     if (!this._expanded) {
       this.expand();
     } else {
       this.collapse();
     }
   },
 
   /**
    * Handler for the "click" event on the element displaying this tree item.
    */
-  _onClick: function (e) {
+  _onClick: function(e) {
     e.stopPropagation();
     this.focus();
   },
 
   /**
    * Handler for the "dblclick" event on the element displaying this tree item.
    */
-  _onDoubleClick: function (e) {
+  _onDoubleClick: function(e) {
     // Ignore dblclick on the arrow as it has already recived and handled two
     // click events.
     if (!e.target.classList.contains("arrow")) {
       this._onArrowClick(e);
     }
     this.focus();
   },
 
   /**
    * Handler for the "keydown" event on the element displaying this tree item.
    */
-  _onKeyDown: function (e) {
+  _onKeyDown: function(e) {
     // Prevent scrolling when pressing navigation keys.
     ViewHelpers.preventScrolling(e);
 
     switch (e.keyCode) {
       case KeyCodes.DOM_VK_UP:
         this._focusPrevNode();
         return;
 
@@ -630,26 +636,25 @@ AbstractTreeItem.prototype = {
         return;
 
       case KeyCodes.DOM_VK_HOME:
         this._focusFirstNode();
         return;
 
       case KeyCodes.DOM_VK_END:
         this._focusLastNode();
-        return;
     }
   },
 
   /**
    * Handler for the "focus" event on the element displaying this tree item.
    */
-  _onFocus: function (e) {
+  _onFocus: function(e) {
     this._rootItem.emit("focus", this);
   },
 
   /**
    * Handler for the "blur" event on the element displaying this tree item.
    */
-  _onBlur: function (e) {
+  _onBlur: function(e) {
     this._rootItem.emit("blur", this);
   }
 };
--- a/devtools/client/shared/widgets/BreadcrumbsWidget.jsm
+++ b/devtools/client/shared/widgets/BreadcrumbsWidget.jsm
@@ -62,52 +62,52 @@ BreadcrumbsWidget.prototype = {
    *
    * @param number aIndex
    *        The position in the container intended for this item.
    * @param nsIDOMNode aContents
    *        The node displayed in the container.
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  insertItemAt: function (aIndex, aContents) {
+  insertItemAt: function(aIndex, aContents) {
     let list = this._list;
     let breadcrumb = new Breadcrumb(this, aContents);
     return list.insertBefore(breadcrumb._target, list.childNodes[aIndex]);
   },
 
   /**
    * Returns the child node in this container situated at the specified index.
    *
    * @param number aIndex
    *        The position in the container intended for this item.
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  getItemAtIndex: function (aIndex) {
+  getItemAtIndex: function(aIndex) {
     return this._list.childNodes[aIndex];
   },
 
   /**
    * Removes the specified child node from this container.
    *
    * @param nsIDOMNode aChild
    *        The element associated with the displayed item.
    */
-  removeChild: function (aChild) {
+  removeChild: function(aChild) {
     this._list.removeChild(aChild);
 
     if (this._selectedItem == aChild) {
       this._selectedItem = null;
     }
   },
 
   /**
    * Removes all of the child nodes from this container.
    */
-  removeAllItems: function () {
+  removeAllItems: function() {
     let list = this._list;
 
     while (list.hasChildNodes()) {
       list.firstChild.remove();
     }
 
     this._selectedItem = null;
   },
@@ -143,58 +143,62 @@ BreadcrumbsWidget.prototype = {
   /**
    * Returns the value of the named attribute on this container.
    *
    * @param string aName
    *        The name of the attribute.
    * @return string
    *         The current attribute value.
    */
-  getAttribute: function (aName) {
-    if (aName == "scrollPosition") return this._list.scrollPosition;
-    if (aName == "scrollWidth") return this._list.scrollWidth;
+  getAttribute: function(aName) {
+    if (aName == "scrollPosition") {
+      return this._list.scrollPosition;
+    }
+    if (aName == "scrollWidth") {
+      return this._list.scrollWidth;
+    }
     return this._parent.getAttribute(aName);
   },
 
   /**
    * Ensures the specified element is visible.
    *
    * @param nsIDOMNode aElement
    *        The element to make visible.
    */
-  ensureElementIsVisible: function (aElement) {
+  ensureElementIsVisible: function(aElement) {
     if (!aElement) {
       return;
     }
 
     // Repeated calls to ensureElementIsVisible would interfere with each other
     // and may sometimes result in incorrect scroll positions.
     setNamedTimeout("breadcrumb-select", ENSURE_SELECTION_VISIBLE_DELAY, () => {
       if (this._list.ensureElementIsVisible) {
         this._list.ensureElementIsVisible(aElement);
       }
     });
   },
 
   /**
    * The underflow and overflow listener for the arrowscrollbox container.
    */
-  _onUnderflow: function ({ target }) {
+  _onUnderflow: function({ target }) {
     if (target != this._list) {
       return;
     }
     target._scrollButtonUp.collapsed = true;
     target._scrollButtonDown.collapsed = true;
     target.removeAttribute("overflows");
   },
 
   /**
    * The underflow and overflow listener for the arrowscrollbox container.
    */
-  _onOverflow: function ({ target }) {
+  _onOverflow: function({ target }) {
     if (target != this._list) {
       return;
     }
     target._scrollButtonUp.collapsed = false;
     target._scrollButtonDown.collapsed = false;
     target.setAttribute("overflows", "");
   },
 
--- a/devtools/client/shared/widgets/SideMenuWidget.jsm
+++ b/devtools/client/shared/widgets/SideMenuWidget.jsm
@@ -95,32 +95,32 @@ SideMenuWidget.prototype = {
    * @param object aAttachment [optional]
    *        Some attached primitive/object. Custom options supported:
    *          - group: a string specifying the group to place this item into
    *          - checkboxState: the checked state of the checkbox, if shown
    *          - checkboxTooltip: the tooltip text for the checkbox, if shown
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  insertItemAt: function (aIndex, aContents, aAttachment = {}) {
+  insertItemAt: function(aIndex, aContents, aAttachment = {}) {
     let group = this._getMenuGroupForName(aAttachment.group);
     let item = this._getMenuItemForGroup(group, aContents, aAttachment);
     let element = item.insertSelfAt(aIndex);
 
     return element;
   },
 
   /**
    * Checks to see if the list is scrolled all the way to the bottom.
    * Uses getBoundsWithoutFlushing to limit the performance impact
    * of this function.
    *
    * @return bool
    */
-  isScrolledToBottom: function () {
+  isScrolledToBottom: function() {
     if (this._list.lastElementChild) {
       let utils = this.window.QueryInterface(Ci.nsIInterfaceRequestor)
                              .getInterface(Ci.nsIDOMWindowUtils);
       let childRect = utils.getBoundsWithoutFlushing(this._list.lastElementChild);
       let listRect = utils.getBoundsWithoutFlushing(this._list);
 
       // Cheap way to check if it's scrolled all the way to the bottom.
       return (childRect.height + childRect.top) <= listRect.bottom;
@@ -128,56 +128,56 @@ SideMenuWidget.prototype = {
 
     return false;
   },
 
   /**
    * Scroll the list to the bottom after a timeout.
    * If the user scrolls in the meantime, cancel this operation.
    */
-  scrollToBottom: function () {
+  scrollToBottom: function() {
     this._list.scrollTop = this._list.scrollHeight;
     this.emit("scroll-to-bottom");
   },
 
   /**
    * Returns the child node in this container situated at the specified index.
    *
    * @param number aIndex
    *        The position in the container intended for this item.
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  getItemAtIndex: function (aIndex) {
+  getItemAtIndex: function(aIndex) {
     return this._orderedMenuElementsArray[aIndex];
   },
 
   /**
    * Removes the specified child node from this container.
    *
    * @param nsIDOMNode aChild
    *        The element associated with the displayed item.
    */
-  removeChild: function (aChild) {
+  removeChild: function(aChild) {
     this._getNodeForContents(aChild).remove();
 
     this._orderedMenuElementsArray.splice(
       this._orderedMenuElementsArray.indexOf(aChild), 1);
 
     this._itemsByElement.delete(aChild);
 
     if (this._selectedItem == aChild) {
       this._selectedItem = null;
     }
   },
 
   /**
    * Removes all of the child nodes from this container.
    */
-  removeAllItems: function () {
+  removeAllItems: function() {
     let parent = this._parent;
     let list = this._list;
 
     while (list.hasChildNodes()) {
       list.firstChild.remove();
     }
 
     this._selectedItem = null;
@@ -217,40 +217,40 @@ SideMenuWidget.prototype = {
   },
 
   /**
    * Ensures the specified element is visible.
    *
    * @param nsIDOMNode aElement
    *        The element to make visible.
    */
-  ensureElementIsVisible: function (aElement) {
+  ensureElementIsVisible: function(aElement) {
     if (!aElement) {
       return;
     }
 
     // Ensure the element is visible but not scrolled horizontally.
     let boxObject = this._list.boxObject;
     boxObject.ensureElementIsVisible(aElement);
     boxObject.scrollBy(-this._list.clientWidth, 0);
   },
 
   /**
    * Shows all the groups, even the ones with no visible children.
    */
-  showEmptyGroups: function () {
+  showEmptyGroups: function() {
     for (let group of this._orderedGroupElementsArray) {
       group.hidden = false;
     }
   },
 
   /**
    * Hides all the groups which have no visible children.
    */
-  hideEmptyGroups: function () {
+  hideEmptyGroups: function() {
     let visibleChildNodes = ".side-menu-widget-item-contents:not([hidden=true])";
 
     for (let group of this._orderedGroupElementsArray) {
       group.hidden = group.querySelectorAll(visibleChildNodes).length == 0;
     }
     for (let menuItem of this._orderedMenuElementsArray) {
       menuItem.parentNode.hidden = menuItem.hidden;
     }
@@ -259,47 +259,47 @@ SideMenuWidget.prototype = {
   /**
    * Adds a new attribute or changes an existing attribute on this container.
    *
    * @param string aName
    *        The name of the attribute.
    * @param string aValue
    *        The desired attribute value.
    */
-  setAttribute: function (aName, aValue) {
+  setAttribute: function(aName, aValue) {
     this._parent.setAttribute(aName, aValue);
 
     if (aName == "emptyText") {
       this._textWhenEmpty = aValue;
     }
   },
 
   /**
    * Removes an attribute on this container.
    *
    * @param string aName
    *        The name of the attribute.
    */
-  removeAttribute: function (aName) {
+  removeAttribute: function(aName) {
     this._parent.removeAttribute(aName);
 
     if (aName == "emptyText") {
       this._removeEmptyText();
     }
   },
 
   /**
    * Set the checkbox state for the item associated with the given node.
    *
    * @param nsIDOMNode aNode
    *        The dom node for an item we want to check.
    * @param boolean aCheckState
    *        True to check, false to uncheck.
    */
-  checkItem: function (aNode, aCheckState) {
+  checkItem: function(aNode, aCheckState) {
     const widgetItem = this._itemsByElement.get(aNode);
     if (!widgetItem) {
       throw new Error("No item for " + aNode);
     }
     widgetItem.check(aCheckState);
   },
 
   /**
@@ -312,32 +312,32 @@ SideMenuWidget.prototype = {
     }
     this._emptyTextValue = aValue;
     this._showEmptyText();
   },
 
   /**
    * Creates and appends a label signaling that this container is empty.
    */
-  _showEmptyText: function () {
+  _showEmptyText: function() {
     if (this._emptyTextNode || !this._emptyTextValue) {
       return;
     }
     let label = this.document.createElement("label");
     label.className = "plain side-menu-widget-empty-text";
     label.setAttribute("value", this._emptyTextValue);
 
     this._parent.insertBefore(label, this._list);
     this._emptyTextNode = label;
   },
 
   /**
    * Removes the label representing a notice in this container.
    */
-  _removeEmptyText: function () {
+  _removeEmptyText: function() {
     if (!this._emptyTextNode) {
       return;
     }
 
     this._parent.removeChild(this._emptyTextNode);
     this._emptyTextNode = null;
   },
 
@@ -345,17 +345,17 @@ SideMenuWidget.prototype = {
    * Gets a container representing a group for menu items. If the container
    * is not available yet, it is immediately created.
    *
    * @param string aName
    *        The required group name.
    * @return SideMenuGroup
    *         The newly created group.
    */
-  _getMenuGroupForName: function (aName) {
+  _getMenuGroupForName: function(aName) {
     let cachedGroup = this._groupsByName.get(aName);
     if (cachedGroup) {
       return cachedGroup;
     }
 
     let group = new SideMenuGroup(this, aName, {
       showCheckbox: this._showGroupCheckboxes
     });
@@ -372,17 +372,17 @@ SideMenuWidget.prototype = {
    *
    * @param SideMenuGroup aGroup
    *        The group to contain the menu item.
    * @param nsIDOMNode aContents
    *        The node displayed in the container.
    * @param object aAttachment [optional]
    *        Some attached primitive/object.
    */
-  _getMenuItemForGroup: function (aGroup, aContents, aAttachment) {
+  _getMenuItemForGroup: function(aGroup, aContents, aAttachment) {
     return new SideMenuItem(aGroup, aContents, aAttachment, {
       showArrow: this._showArrows,
       showCheckbox: this._showItemCheckboxes
     });
   },
 
   /**
    * Returns the .side-menu-widget-item node corresponding to a SideMenuItem.
@@ -390,28 +390,27 @@ SideMenuWidget.prototype = {
    * these child items, in which case we need to be careful on which nodes
    * .selected class names are added, or which nodes are removed.
    *
    * @param nsIDOMNode aChild
    *        An element which is the target node of a SideMenuItem.
    * @return nsIDOMNode
    *         The wrapper node if there is one, or the same child otherwise.
    */
-  _getNodeForContents: function (aChild) {
+  _getNodeForContents: function(aChild) {
     if (aChild.hasAttribute("merged-item-contents")) {
       return aChild;
-    } else {
-      return aChild.parentNode;
     }
+    return aChild.parentNode;
   },
 
   /**
    * Shows the contextMenu element.
    */
-  _showContextMenu: function (e) {
+  _showContextMenu: function(e) {
     if (!this._contextMenu) {
       return;
     }
 
     // Don't show the menu if a descendant node is going to be visible also.
     let node = e.originalTarget;
     while (node && node !== this._list) {
       if (node.hasAttribute("contextmenu")) {
@@ -498,25 +497,27 @@ function SideMenuGroup(aWidget, aName, a
 
 SideMenuGroup.prototype = {
   get _orderedGroupElementsArray() {
     return this.ownerView._orderedGroupElementsArray;
   },
   get _orderedMenuElementsArray() {
     return this.ownerView._orderedMenuElementsArray;
   },
-  get _itemsByElement() { return this.ownerView._itemsByElement; },
+  get _itemsByElement() {
+    return this.ownerView._itemsByElement;
+  },
 
   /**
    * Inserts this group in the parent container at the specified index.
    *
    * @param number aIndex
    *        The position in the container intended for this group.
    */
-  insertSelfAt: function (aIndex) {
+  insertSelfAt: function(aIndex) {
     let ownerList = this.ownerView._list;
     let groupsArray = this._orderedGroupElementsArray;
 
     if (aIndex >= 0) {
       ownerList.insertBefore(this._target, groupsArray[aIndex]);
       groupsArray.splice(aIndex, 0, this._target);
     } else {
       ownerList.appendChild(this._target);
@@ -525,17 +526,17 @@ SideMenuGroup.prototype = {
   },
 
   /**
    * Finds the expected index of this group based on its name.
    *
    * @return number
    *         The expected index.
    */
-  findExpectedIndexForSelf: function (sortPredicate) {
+  findExpectedIndexForSelf: function(sortPredicate) {
     let identifier = this.identifier;
     let groupsArray = this._orderedGroupElementsArray;
 
     for (let group of groupsArray) {
       let name = group.getAttribute("name");
       if (sortPredicate(name, identifier) > 0 && // Insertion sort at its best :)
           !name.includes(identifier)) { // Least significant group should be last.
         return groupsArray.indexOf(group);
@@ -609,27 +610,29 @@ function SideMenuItem(aGroup, aContents,
 
 SideMenuItem.prototype = {
   get _orderedGroupElementsArray() {
     return this.ownerView._orderedGroupElementsArray;
   },
   get _orderedMenuElementsArray() {
     return this.ownerView._orderedMenuElementsArray;
   },
-  get _itemsByElement() { return this.ownerView._itemsByElement; },
+  get _itemsByElement() {
+    return this.ownerView._itemsByElement;
+  },
 
   /**
    * Inserts this item in the parent group at the specified index.
    *
    * @param number aIndex
    *        The position in the container intended for this item.
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  insertSelfAt: function (aIndex) {
+  insertSelfAt: function(aIndex) {
     let ownerList = this.ownerView._list;
     let menuArray = this._orderedMenuElementsArray;
 
     if (aIndex >= 0) {
       ownerList.insertBefore(this._container, ownerList.childNodes[aIndex]);
       menuArray.splice(aIndex, 0, this._target);
     } else {
       ownerList.appendChild(this._container);
@@ -641,17 +644,17 @@ SideMenuItem.prototype = {
   },
 
   /**
    * Check or uncheck the checkbox associated with this item.
    *
    * @param boolean aCheckState
    *        True to check, false to uncheck.
    */
-  check: function (aCheckState) {
+  check: function(aCheckState) {
     if (!this._checkbox) {
       throw new Error("Cannot check items that do not have checkboxes.");
     }
     // Don't set or remove the "checked" attribute, assign the property instead.
     // Otherwise, the "CheckboxStateChange" event will not be fired. XUL!!
     this._checkbox.checked = !!aCheckState;
   },
 
--- a/devtools/client/shared/widgets/SimpleListWidget.jsm
+++ b/devtools/client/shared/widgets/SimpleListWidget.jsm
@@ -44,53 +44,53 @@ SimpleListWidget.prototype = {
    *
    * @param number aIndex
    *        The position in the container intended for this item.
    * @param nsIDOMNode aContents
    *        The node displayed in the container.
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  insertItemAt: function (aIndex, aContents) {
+  insertItemAt: function(aIndex, aContents) {
     aContents.classList.add("simple-list-widget-item");
 
     let list = this._list;
     return list.insertBefore(aContents, list.childNodes[aIndex]);
   },
 
   /**
    * Returns the child node in this container situated at the specified index.
    *
    * @param number aIndex
    *        The position in the container intended for this item.
    * @return nsIDOMNode
    *         The element associated with the displayed item.
    */
-  getItemAtIndex: function (aIndex) {
+  getItemAtIndex: function(aIndex) {
     return this._list.childNodes[aIndex];
   },
 
   /**
    * Immediately removes the specified child node from this container.
    *
    * @param nsIDOMNode aChild
    *        The element associated with the displayed item.
    */
-  removeChild: function (aChild) {
+  removeChild: function(aChild) {
     this._list.removeChild(aChild);
 
     if (this._selectedItem == aChild) {
       this._selectedItem = null;
     }
   },
 
   /**
    * Removes all of the child nodes from this container.
    */
-  removeAllItems: function () {
+  removeAllItems: function() {
     let list = this._list;
     let parent = this._parent;
 
     while (list.hasChildNodes()) {
       list.firstChild.remove();
     }
 
     parent.scrollTop = 0;
@@ -129,47 +129,47 @@ SimpleListWidget.prototype = {
   /**
    * Adds a new attribute or changes an existing attribute on this container.
    *
    * @param string aName
    *        The name of the attribute.
    * @param string aValue
    *        The desired attribute value.
    */
-  setAttribute: function (aName, aValue) {
+  setAttribute: function(aName, aValue) {
     this._parent.setAttribute(aName, aValue);
 
     if (aName == "emptyText") {
       this._textWhenEmpty = aValue;
     } else if (aName == "headerText") {
       this._textAsHeader = aValue;
     }
   },
 
   /**
    * Removes an attribute on this container.
    *
    * @param string aName
    *        The name of the attribute.
    */
-  removeAttribute: function (aName) {
+  removeAttribute: function(aName) {
     this._parent.removeAttribute(aName);
 
     if (aName == "emptyText") {
       this._removeEmptyText();
     }
   },
 
   /**
    * Ensures the specified element is visible.
    *
    * @param nsIDOMNode aElement
    *        The element to make visible.
    */
-  ensureElementIsVisible: function (aElement) {
+  ensureElementIsVisible: function(aElement) {
     if (!aElement) {
       return;
     }
 
     // Ensure the element is visible but not scrolled horizontally.
     let boxObject = this._list.boxObject;
     boxObject.ensureElementIsVisible(aElement);
     boxObject.scrollBy(-this._list.clientWidth, 0);
@@ -197,47 +197,47 @@ SimpleListWidget.prototype = {
     }
     this._emptyTextValue = aValue;
     this._showEmptyText();
   },
 
   /**
    * Creates and appends a label displayed as this container's header.
    */
-  _showHeaderText: function () {
+  _showHeaderText: function() {
     if (this._headerTextNode || !this._headerTextValue) {
       return;
     }
     let label = this.document.createElement("label");
     label.className = "plain simple-list-widget-perma-text";
     label.setAttribute("value", this._headerTextValue);
 
     this._parent.insertBefore(label, this._list);
     this._headerTextNode = label;
   },
 
   /**
    * Creates and appends a label signaling that this container is empty.
    */
-  _showEmptyText: function () {
+  _showEmptyText: function() {
     if (this._emptyTextNode || !this._emptyTextValue) {
       return;
     }
     let label = this.document.createElement("label");
     label.className = "plain simple-list-widget-empty-text";
     label.setAttribute("value", this._emptyTextValue);
 
     this._parent.appendChild(label);
     this._emptyTextNode = label;
   },
 
   /**
    * Removes the label signaling that this container is empty.
    */
-  _removeEmptyText: function () {
+  _removeEmptyText: function() {
     if (!this._emptyTextNode) {
       return;
     }
     this._parent.removeChild(this._emptyTextNode);
     this._emptyTextNode = null;
   },
 
   window: null,
--- a/devtools/client/shared/widgets/VariablesView.jsm
+++ b/devtools/client/shared/widgets/VariablesView.jsm
@@ -30,25 +30,25 @@ const {PluralForm} = require("devtools/s
 const {LocalizationHelper, ELLIPSIS} = require("devtools/shared/l10n");
 const L10N = new LocalizationHelper(DBG_STRINGS_URI);
 
 XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
   "@mozilla.org/widget/clipboardhelper;1",
   "nsIClipboardHelper");
 
 Object.defineProperty(this, "WebConsoleUtils", {
-  get: function () {
+  get: function() {
     return require("devtools/client/webconsole/utils").Utils;
   },
   configurable: true,
   enumerable: true
 });
 
 Object.defineProperty(this, "NetworkHelper", {
-  get: function () {
+  get: function() {
     return require("devtools/shared/webconsole/network-helper");
   },
   configurable: true,
   enumerable: true
 });
 
 this.EXPORTED_SYMBOLS = ["VariablesView", "escapeHTML"];
 
@@ -119,17 +119,17 @@ VariablesView.prototype = {
    *
    * @param string aName
    *        The scope's name (e.g. "Local", "Global" etc.).
    * @param string aCustomClass
    *        An additional class name for the containing element.
    * @return Scope
    *         The newly created Scope instance.
    */
-  addScope: function (aName = "", aCustomClass = "") {
+  addScope: function(aName = "", aCustomClass = "") {
     this._removeEmptyNotice();
     this._toggleSearchVisibility(true);
 
     let scope = new Scope(this, aName, { customClass: aCustomClass });
     this._store.push(scope);
     this._itemsByElement.set(scope._target, scope);
     this._currHierarchy.set(aName, scope);
     scope.header = !!aName;
@@ -139,17 +139,17 @@ VariablesView.prototype = {
 
   /**
    * Removes all items from this container.
    *
    * @param number aTimeout [optional]
    *        The number of milliseconds to delay the operation if
    *        lazy emptying of this container is enabled.
    */
-  empty: function (aTimeout = this.lazyEmptyDelay) {
+  empty: function(aTimeout = this.lazyEmptyDelay) {
     // If there are no items in this container, emptying is useless.
     if (!this._store.length) {
       return;
     }
 
     this._store.length = 0;
     this._itemsByElement = new WeakMap();
     this._prevHierarchy = this._currHierarchy;
@@ -179,17 +179,17 @@ VariablesView.prototype = {
    * immediately attached to the parent container. The old container list
    * is kept around for a short period of time, hopefully accounting for the
    * data fetching delay. In the meantime, any operations can be executed
    * normally.
    *
    * @see VariablesView.empty
    * @see VariablesView.commitHierarchy
    */
-  _emptySoon: function (aTimeout) {
+  _emptySoon: function(aTimeout) {
     let prevList = this._list;
     let currList = this._list = this.document.createElement("scrollbox");
 
     this.window.setTimeout(() => {
       prevList.removeEventListener("keydown", this._onViewKeyDown);
       currList.addEventListener("keydown", this._onViewKeyDown);
       currList.setAttribute("orient", "vertical");
 
@@ -426,17 +426,17 @@ VariablesView.prototype = {
   get searchPlaceholder() {
     return this._searchboxPlaceholder;
   },
 
   /**
    * Enables variable and property searching in this view.
    * Use the "searchEnabled" setter to enable searching.
    */
-  _enableSearch: function () {
+  _enableSearch: function() {
     // If searching was already enabled, no need to re-enable it again.
     if (this._searchboxContainer) {
       return;
     }
     let document = this.document;
     let ownerNode = this._parent.parentNode;
 
     let container = this._searchboxContainer = document.createElement("hbox");
@@ -457,17 +457,17 @@ VariablesView.prototype = {
     container.appendChild(searchbox);
     ownerNode.insertBefore(container, this._parent);
   },
 
   /**
    * Disables variable and property searching in this view.
    * Use the "searchEnabled" setter to disable searching.
    */
-  _disableSearch: function () {
+  _disableSearch: function() {
     // If searching was already disabled, no need to re-disable it again.
     if (!this._searchboxContainer) {
       return;
     }
     this._searchboxContainer.remove();
     this._searchboxNode.removeEventListener("command", this._onSearchboxInput);
     this._searchboxNode.removeEventListener("keydown", this._onSearchboxKeyDown);
 
@@ -477,55 +477,54 @@ VariablesView.prototype = {
 
   /**
    * Sets the variables searchbox container hidden or visible.
    * It's hidden by default.
    *
    * @param boolean aVisibleFlag
    *        Specifies the intended visibility.
    */
-  _toggleSearchVisibility: function (aVisibleFlag) {
+  _toggleSearchVisibility: function(aVisibleFlag) {
     // If searching was already disabled, there's no need to hide it.
     if (!this._searchboxContainer) {
       return;
     }
     this._searchboxContainer.hidden = !aVisibleFlag;
   },
 
   /**
    * Listener handling the searchbox input event.
    */
-  _onSearchboxInput: function () {
+  _onSearchboxInput: function() {
     this.scheduleSearch(this._searchboxNode.value);
   },
 
   /**
    * Listener handling the searchbox keydown event.
    */
-  _onSearchboxKeyDown: function (e) {
+  _onSearchboxKeyDown: function(e) {
     switch (e.keyCode) {
       case KeyCodes.DOM_VK_RETURN:
         this._onSearchboxInput();
         return;
       case KeyCodes.DOM_VK_ESCAPE:
         this._searchboxNode.value = "";
         this._onSearchboxInput();
-        return;
     }
   },
 
   /**
    * Schedules searching for variables or properties matching the query.
    *
    * @param string aToken
    *        The variable or property to search for.
    * @param number aWait
    *        The amount of milliseconds to wait until draining.
    */
-  scheduleSearch: function (aToken, aWait) {
+  scheduleSearch: function(aToken, aWait) {
     // Check if this search operation may not be executed lazily.
     if (!this.lazySearch) {
       this._doSearch(aToken);
       return;
     }
 
     // The amount of time to wait for the requests to settle.
     let maxDelay = SEARCH_ACTION_MAX_DELAY;
@@ -541,17 +540,17 @@ VariablesView.prototype = {
    *
    * If aToken is falsy, then all the scopes are unhidden and expanded,
    * while the available variables and properties inside those scopes are
    * just unhidden.
    *
    * @param string aToken
    *        The variable or property to search for.
    */
-  _doSearch: function (aToken) {
+  _doSearch: function(aToken) {
     if (this.controller && this.controller.supportsSearch()) {
       // Retrieve the main Scope in which we add attributes
       let scope = this._store[0]._store.get(undefined);
       if (!aToken) {
         // Prune the view from old previous content
         // so that we delete the intermediate search results
         // we created in previous searches
         for (let property of scope._store.values()) {
@@ -587,17 +586,17 @@ VariablesView.prototype = {
    * user). Descends into each scope to check the scope and its children.
    *
    * @param function aPredicate
    *        A function that returns true when a match is found.
    * @return Scope | Variable | Property
    *         The first visible scope, variable or property, or null if nothing
    *         is found.
    */
-  _findInVisibleItems: function (aPredicate) {
+  _findInVisibleItems: function(aPredicate) {
     for (let scope of this._store) {
       let result = scope._findInVisibleItems(aPredicate);
       if (result) {
         return result;
       }
     }
     return null;
   },
@@ -609,17 +608,17 @@ VariablesView.prototype = {
    * its children.
    *
    * @param function aPredicate
    *        A function that returns true when a match is found.
    * @return Scope | Variable | Property
    *         The last visible scope, variable or property, or null if nothing
    *         is found.
    */
-  _findInVisibleItemsReverse: function (aPredicate) {
+  _findInVisibleItemsReverse: function(aPredicate) {
     for (let i = this._store.length - 1; i >= 0; i--) {
       let scope = this._store[i];
       let result = scope._findInVisibleItemsReverse(aPredicate);
       if (result) {
         return result;
       }
     }
     return null;
@@ -628,42 +627,42 @@ VariablesView.prototype = {
   /**
    * Gets the scope at the specified index.
    *
    * @param number aIndex
    *        The scope's index.
    * @return Scope
    *         The scope if found, undefined if not.
    */
-  getScopeAtIndex: function (aIndex) {
+  getScopeAtIndex: function(aIndex) {
     return this._store[aIndex];
   },
 
   /**
    * Recursively searches this container for the scope, variable or property
    * displayed by the specified node.
    *
    * @param nsIDOMNode aNode
    *        The node to search for.
    * @return Scope | Variable | Property
    *         The matched scope, variable or property, or null if nothing is found.
    */
-  getItemForNode: function (aNode) {
+  getItemForNode: function(aNode) {
     return this._itemsByElement.get(aNode);
   },
 
   /**
    * Gets the scope owning a Variable or Property.
    *
    * @param Variable | Property
    *        The variable or property to retrieven the owner scope for.
    * @return Scope
    *         The owner scope.
    */
-  getOwnerScopeForVariableOrProperty: function (aItem) {
+  getOwnerScopeForVariableOrProperty: function(aItem) {
     if (!aItem) {
       return null;
     }
     // If this is a Scope, return it.
     if (!(aItem instanceof Variable)) {
       return aItem;
     }
     // If this is a Variable or Property, find its owner scope.
@@ -677,78 +676,78 @@ VariablesView.prototype = {
    * Gets the parent scopes for a specified Variable or Property.
    * The returned list will not include the owner scope.
    *
    * @param Variable | Property
    *        The variable or property for which to find the parent scopes.
    * @return array
    *         A list of parent Scopes.
    */
-  getParentScopesForVariableOrProperty: function (aItem) {
+  getParentScopesForVariableOrProperty: function(aItem) {
     let scope = this.getOwnerScopeForVariableOrProperty(aItem);
     return this._store.slice(0, Math.max(this._store.indexOf(scope), 0));
   },
 
   /**
    * Gets the currently focused scope, variable or property in this view.
    *
    * @return Scope | Variable | Property
    *         The focused scope, variable or property, or null if nothing is found.
    */
-  getFocusedItem: function () {
+  getFocusedItem: function() {
     let focused = this.document.commandDispatcher.focusedElement;
     return this.getItemForNode(focused);
   },
 
   /**
    * Focuses the first visible scope, variable, or property in this container.
    */
-  focusFirstVisibleItem: function () {
+  focusFirstVisibleItem: function() {
     let focusableItem = this._findInVisibleItems(item => item.focusable);
     if (focusableItem) {
       this._focusItem(focusableItem);
     }
     this._parent.scrollTop = 0;
     this._parent.scrollLeft = 0;
   },
 
   /**
    * Focuses the last visible scope, variable, or property in this container.
    */
-  focusLastVisibleItem: function () {
+  focusLastVisibleItem: function() {
     let focusableItem = this._findInVisibleItemsReverse(item => item.focusable);
     if (focusableItem) {
       this._focusItem(focusableItem);
     }
     this._parent.scrollTop = this._parent.scrollHeight;
     this._parent.scrollLeft = 0;
   },
 
   /**
    * Focuses the next scope, variable or property in this view.
    */
-  focusNextItem: function () {
+  focusNextItem: function() {
     this.focusItemAtDelta(+1);
   },
 
   /**
    * Focuses the previous scope, variable or property in this view.
    */
-  focusPrevItem: function () {
+  focusPrevItem: function() {
     this.focusItemAtDelta(-1);
   },
 
   /**
    * Focuses another scope, variable or property in this view, based on
    * the index distance from the currently focused item.
    *
    * @param number aDelta
    *        A scalar specifying by how many items should the selection change.
    */
-  focusItemAtDelta: function (aDelta) {
+  focusItemAtDelta: function(aDelta) {
     let direction = aDelta > 0 ? "advanceFocus" : "rewindFocus";
     let distance = Math.abs(Math[aDelta > 0 ? "ceil" : "floor"](aDelta));
     while (distance--) {
       if (!this._focusChange(direction)) {
         break; // Out of bounds.
       }
     }
   },
@@ -757,17 +756,17 @@ VariablesView.prototype = {
    * Focuses the next or previous scope, variable or property in this view.
    *
    * @param string aDirection
    *        Either "advanceFocus" or "rewindFocus".
    * @return boolean
    *         False if the focus went out of bounds and the first or last element
    *         in this view was focused instead.
    */
-  _focusChange: function (aDirection) {
+  _focusChange: function(aDirection) {
     let commandDispatcher = this.document.commandDispatcher;
     let prevFocusedElement = commandDispatcher.focusedElement;
     let currFocusedItem = null;
 
     do {
       commandDispatcher.suppressFocusScroll = true;
       commandDispatcher[aDirection]();
 
@@ -788,32 +787,32 @@ VariablesView.prototype = {
    *
    * @param aItem Scope | Variable | Property
    *        The item to focus.
    * @param boolean aCollapseFlag
    *        True if the focused item should also be collapsed.
    * @return boolean
    *         True if the item was successfully focused.
    */
-  _focusItem: function (aItem, aCollapseFlag) {
+  _focusItem: function(aItem, aCollapseFlag) {
     if (!aItem.focusable) {
       return false;
     }
     if (aCollapseFlag) {
       aItem.collapse();
     }
     aItem._target.focus();
     this.boxObject.ensureElementIsVisible(aItem._arrow);
     return true;
   },
 
   /**
    * Listener handling a key down event on the view.
    */
-  _onViewKeyDown: function (e) {
+  _onViewKeyDown: function(e) {
     let item = this.getFocusedItem();
 
     // Prevent scrolling when pressing navigation keys.
     ViewHelpers.preventScrolling(e);
 
     switch (e.keyCode) {
       case KeyCodes.DOM_VK_C:
         // Copy current selection to clipboard.
@@ -895,17 +894,16 @@ VariablesView.prototype = {
         // Delete the Variable or Property if allowed.
         if (item instanceof Variable) {
           item._onDelete(e);
         }
         return;
 
       case KeyCodes.DOM_VK_INSERT:
         item._onAddProperty(e);
-        return;
     }
   },
 
   /**
    * Sets the text displayed in this container when there are no available items.
    * @param string aValue
    */
   set emptyText(aValue) {
@@ -914,33 +912,33 @@ VariablesView.prototype = {
     }
     this._emptyTextValue = aValue;
     this._appendEmptyNotice();
   },
 
   /**
    * Creates and appends a label signaling that this container is empty.
    */
-  _appendEmptyNotice: function () {
+  _appendEmptyNotice: function() {
     if (this._emptyTextNode || !this._emptyTextValue) {
       return;
     }
 
     let label = this.document.createElement("label");
     label.className = "variables-view-empty-notice";
     label.setAttribute("value", this._emptyTextValue);
 
     this._parent.appendChild(label);
     this._emptyTextNode = label;
   },
 
   /**
    * Removes the label signaling that this container is empty.
    */
-  _removeEmptyNotice: function () {
+  _removeEmptyNotice: function() {
     if (!this._emptyTextNode) {
       return;
     }
 
     this._parent.removeChild(this._emptyTextNode);
     this._emptyTextNode = null;
   },
 
@@ -1057,50 +1055,50 @@ VariablesView.NON_SORTABLE_CLASSES = [
 ];
 
 /**
  * Determine whether an object's properties should be sorted based on its class.
  *
  * @param string aClassName
  *        The class of the object.
  */
-VariablesView.isSortable = function (aClassName) {
+VariablesView.isSortable = function(aClassName) {
   return !VariablesView.NON_SORTABLE_CLASSES.includes(aClassName);
 };
 
 /**
  * Generates the string evaluated when performing simple value changes.
  *
  * @param Variable | Property aItem
  *        The current variable or property.
  * @param string aCurrentString
  *        The trimmed user inputted string.
  * @param string aPrefix [optional]
  *        Prefix for the symbolic name.
  * @return string
  *         The string to be evaluated.
  */
-VariablesView.simpleValueEvalMacro = function (aItem, aCurrentString, aPrefix = "") {
+VariablesView.simpleValueEvalMacro = function(aItem, aCurrentString, aPrefix = "") {
   return aPrefix + aItem.symbolicName + "=" + aCurrentString;
 };
 
 /**
  * Generates the string evaluated when overriding getters and setters with
  * plain values.
  *
  * @param Property aItem
  *        The current getter or setter property.
  * @param string aCurrentString
  *        The trimmed user inputted string.
  * @param string aPrefix [optional]
  *        Prefix for the symbolic name.
  * @return string
  *         The string to be evaluated.
  */
-VariablesView.overrideValueEvalMacro = function (aItem, aCurrentString, aPrefix = "") {
+VariablesView.overrideValueEvalMacro = function(aItem, aCurrentString, aPrefix = "") {
   let property = escapeString(aItem._nameString);
   let parent = aPrefix + aItem.ownerView.symbolicName || "this";
 
   return "Object.defineProperty(" + parent + "," + property + "," +
     "{ value: " + aCurrentString +
     ", enumerable: " + parent + ".propertyIsEnumerable(" + property + ")" +
     ", configurable: true" +
     ", writable: true" +
@@ -1114,17 +1112,17 @@ VariablesView.overrideValueEvalMacro = f
  *        The current getter or setter property.
  * @param string aCurrentString
  *        The trimmed user inputted string.
  * @param string aPrefix [optional]
  *        Prefix for the symbolic name.
  * @return string
  *         The string to be evaluated.
  */
-VariablesView.getterOrSetterEvalMacro = function (aItem, aCurrentString, aPrefix = "") {
+VariablesView.getterOrSetterEvalMacro = function(aItem, aCurrentString, aPrefix = "") {
   let type = aItem._nameString;
   let propertyObject = aItem.ownerView;
   let parentObject = propertyObject.ownerView;
   let property = escapeString(propertyObject._nameString);
   let parent = aPrefix + parentObject.symbolicName || "this";
 
   switch (aCurrentString) {
     case "":
@@ -1190,27 +1188,26 @@ VariablesView.getterOrSetterEvalMacro = 
 };
 
 /**
  * Function invoked when a getter or setter is deleted.
  *
  * @param Property aItem
  *        The current getter or setter property.
  */
-VariablesView.getterOrSetterDeleteCallback = function (aItem) {
+VariablesView.getterOrSetterDeleteCallback = function(aItem) {
   aItem._disable();
 
   // Make sure the right getter/setter to value override macro is applied
   // to the target object.
   aItem.ownerView.eval(aItem, "");
 
   return true; // Don't hide the element.
 };
 
-
 /**
  * A Scope is an object holding Variable instances.
  * Iterable via "for (let [name, variable] of instance) { }".
  *
  * @param VariablesView aView
  *        The view to contain this scope.
  * @param string aName
  *        The scope's name.
@@ -1267,17 +1264,17 @@ Scope.prototype = {
    *        The name of the new Property.
    * @param object aDescriptor
    *        The variable's descriptor.
    * @param object aOptions
    *        Options of the form accepted by addItem.
    * @return Variable
    *         The newly created child Variable.
    */
-  _createChild: function (aName, aDescriptor, aOptions) {
+  _createChild: function(aName, aDescriptor, aOptions) {
     return new Variable(this, aName, aDescriptor, aOptions);
   },
 
   /**
    * Adds a child to contain any inspected properties.
    *
    * @param string aName
    *        The child's name.
@@ -1303,17 +1300,17 @@ Scope.prototype = {
    *        * boolean internalItem  true if the item is internally generated.
    *                           This is used for special variables
    *                           like <return> or <exception> and distinguishes
    *                           them from ordinary properties that happen
    *                           to have the same name
    * @return Variable
    *         The newly created Variable instance, null if it already exists.
    */
-  addItem: function (aName, aDescriptor = {}, aOptions = {}) {
+  addItem: function(aName, aDescriptor = {}, aOptions = {}) {
     let {relaxed} = aOptions;
     if (this._store.has(aName) && !relaxed) {
       return this._store.get(aName);
     }
 
     let child = this._createChild(aName, aDescriptor, aOptions);
     this._store.set(aName, child);
     this._variablesView._itemsByElement.set(child._target, child);
@@ -1339,17 +1336,17 @@ Scope.prototype = {
    *                 someProp5: { value: { type: "object", class: "Object" } },
    *                 someProp6: { get: { type: "object", class: "Function" },
    *                              set: { type: "undefined" } } }
    * @param object aOptions [optional]
    *        Additional options for adding the properties. Supported options:
    *        - sorted: true to sort all the properties before adding them
    *        - callback: function invoked after each item is added
    */
-  addItems: function (aItems, aOptions = {}) {
+  addItems: function(aItems, aOptions = {}) {
     let names = Object.keys(aItems);
 
     // Sort all of the properties before adding them, if preferred.
     if (aOptions.sorted) {
       names.sort(this._naturalSort);
     }
 
     // Add the properties to the current scope.
@@ -1361,17 +1358,17 @@ Scope.prototype = {
         aOptions.callback(item, descriptor && descriptor.value);
       }
     }
   },
 
   /**
    * Remove this Scope from its parent and remove all children recursively.
    */
-  remove: function () {
+  remove: function() {
     let view = this._variablesView;
     view._store.splice(view._store.indexOf(this), 1);
     view._itemsByElement.delete(this._target);
     view._currHierarchy.delete(this._nameString);
 
     this._target.remove();
 
     for (let variable of this._store.values()) {
@@ -1382,30 +1379,30 @@ Scope.prototype = {
   /**
    * Gets the variable in this container having the specified name.
    *
    * @param string aName
    *        The name of the variable to get.
    * @return Variable
    *         The matched variable, or null if nothing is found.
    */
-  get: function (aName) {
+  get: function(aName) {
     return this._store.get(aName);
   },
 
   /**
    * Recursively searches for the variable or property in this container
    * displayed by the specified node.
    *
    * @param nsIDOMNode aNode
    *        The node to search for.
    * @return Variable | Property
    *         The matched variable or property, or null if nothing is found.
    */
-  find: function (aNode) {
+  find: function(aNode) {
     for (let [, variable] of this._store) {
       let match;
       if (variable._target == aNode) {
         match = variable;
       } else {
         match = variable.find(aNode);
       }
       if (match) {
@@ -1419,70 +1416,70 @@ Scope.prototype = {
    * Determines if this scope is a direct child of a parent variables view,
    * scope, variable or property.
    *
    * @param VariablesView | Scope | Variable | Property
    *        The parent to check.
    * @return boolean
    *         True if the specified item is a direct child, false otherwise.
    */
-  isChildOf: function (aParent) {
+  isChildOf: function(aParent) {
     return this.ownerView == aParent;
   },
 
   /**
    * Determines if this scope is a descendant of a parent variables view,
    * scope, variable or property.
    *
    * @param VariablesView | Scope | Variable | Property
    *        The parent to check.
    * @return boolean
    *         True if the specified item is a descendant, false otherwise.
    */
-  isDescendantOf: function (aParent) {
+  isDescendantOf: function(aParent) {
     if (this.isChildOf(aParent)) {
       return true;
     }
 
     // Recurse to parent if it is a Scope, Variable, or Property.
     if (this.ownerView instanceof Scope) {
       return this.ownerView.isDescendantOf(aParent);
     }
 
     return false;
   },
 
   /**
    * Shows the scope.
    */
-  show: function () {
+  show: function() {
     this._target.hidden = false;
     this._isContentVisible = true;
 
     if (this.onshow) {
       this.onshow(this);
     }
   },
 
   /**
    * Hides the scope.
    */
-  hide: function () {
+  hide: function() {
     this._target.hidden = true;
     this._isContentVisible = false;
 
     if (this.onhide) {
       this.onhide(this);
     }
   },
 
   /**
    * Expands the scope, showing all the added details.
    */
-  expand: function () {
+  expand: function() {
     if (this._isExpanded || this._isLocked) {
       return;
     }
     if (this._variablesView._enumVisible) {
       this._openEnum();
     }
     if (this._variablesView._nonEnumVisible) {
       Services.tm.dispatchToMainThread({ run: this._openNonEnum });
@@ -1496,34 +1493,34 @@ Scope.prototype = {
       // and attributes are available. (Mostly used for tests)
       return this.onexpand(this);
     }
   },
 
   /**
    * Collapses the scope, hiding all the added details.
    */
-  collapse: function () {
+  collapse: function() {
     if (!this._isExpanded || this._isLocked) {
       return;
     }
     this._arrow.removeAttribute("open");
     this._enum.removeAttribute("open");
     this._nonenum.removeAttribute("open");
     this._isExpanded = false;
 
     if (this.oncollapse) {
       this.oncollapse(this);
     }
   },
 
   /**
    * Toggles between the scope's collapsed and expanded state.
    */
-  toggle: function (e) {
+  toggle: function(e) {
     if (e && e.button != 0) {
       // Only allow left-click to trigger this event.
       return;
     }
     this.expanded ^= 1;
 
     // Make sure the scope and its contents are visibile.
     for (let [, variable] of this._store) {
@@ -1533,29 +1530,29 @@ Scope.prototype = {
     if (this.ontoggle) {
       this.ontoggle(this);
     }
   },
 
   /**
    * Shows the scope's title header.
    */
-  showHeader: function () {
+  showHeader: function() {
     if (this._isHeaderVisible || !this._nameString) {
       return;
     }
     this._target.removeAttribute("untitled");
     this._isHeaderVisible = true;
   },
 
   /**
    * Hides the scope's title header.
    * This action will automatically expand the scope.
    */
-  hideHeader: function () {
+  hideHeader: function() {
     if (!this._isHeaderVisible) {
       return;
     }
     this.expand();
     this._target.setAttribute("untitled", "");
     this._isHeaderVisible = false;
   },
 
@@ -1564,37 +1561,37 @@ Scope.prototype = {
    * This only needs to compare non-numbers since it is dealing with an array
    * which numeric-based indices are placed in order.
    *
    * @param string a
    * @param string b
    * @return number
    *         -1 if a is less than b, 0 if no change in order, +1 if a is greater than 0
    */
-  _naturalSort: function (a, b) {
+  _naturalSort: function(a, b) {
     if (isNaN(parseFloat(a)) && isNaN(parseFloat(b))) {
       return a < b ? -1 : 1;
     }
   },
 
   /**
    * Shows the scope's expand/collapse arrow.
    */
-  showArrow: function () {
+  showArrow: function() {
     if (this._isArrowVisible) {
       return;
     }
     this._arrow.removeAttribute("invisible");
     this._isArrowVisible = true;
   },
 
   /**
    * Hides the scope's expand/collapse arrow.
    */
-  hideArrow: function () {
+  hideArrow: function() {
     if (!this._isArrowVisible) {
       return;
     }
     this._arrow.setAttribute("invisible", "");
     this._isArrowVisible = false;
   },
 
   /**
@@ -1699,37 +1696,37 @@ Scope.prototype = {
       }
     }
     return true;
   },
 
   /**
    * Focus this scope.
    */
-  focus: function () {
+  focus: function() {
     this._variablesView._focusItem(this);
   },
 
   /**
    * Adds an event listener for a certain event on this scope's title.
    * @param string aName
    * @param function aCallback
    * @param boolean aCapture
    */
-  addEventListener: function (aName, aCallback, aCapture) {
+  addEventListener: function(aName, aCallback, aCapture) {
     this._title.addEventListener(aName, aCallback, aCapture);
   },
 
   /**
    * Removes an event listener for a certain event on this scope's title.
    * @param string aName
    * @param function aCallback
    * @param boolean aCapture
    */
-  removeEventListener: function (aName, aCallback, aCapture) {
+  removeEventListener: function(aName, aCallback, aCapture) {
     this._title.removeEventListener(aName, aCallback, aCapture);
   },
 
   /**
    * Gets the id associated with this item.
    * @return string
    */
   get id() {
@@ -1771,17 +1768,17 @@ Scope.prototype = {
   /**
    * Initializes this scope's id, view and binds event listeners.
    *
    * @param string aName
    *        The scope's name.
    * @param object aFlags [optional]
    *        Additional options or flags for this scope.
    */
-  _init: function (aName, aFlags) {
+  _init: function(aName, aFlags) {
     this._idString = generateId(this._nameString = aName);
     this._displayScope(aName, `${this.targetClassName} ${aFlags.customClass}`,
                        "devtools-toolbar");
     this._addEventListeners();
     this.parentNode.appendChild(this._target);
   },
 
   /**
@@ -1789,17 +1786,17 @@ Scope.prototype = {
    *
    * @param string aName
    *        The scope's name.
    * @param string aTargetClassName
    *        A custom class name for this scope's target element.
    * @param string aTitleClassName [optional]
    *        A custom class name for this scope's title element.
    */
-  _displayScope: function (aName = "", aTargetClassName, aTitleClassName = "") {
+  _displayScope: function(aName = "", aTargetClassName, aTitleClassName = "") {
     let document = this.document;
 
     let element = this._target = document.createElement("vbox");
     element.id = this._idString;
     element.className = aTargetClassName;
 
     let arrow = this._arrow = document.createElement("hbox");
     arrow.className = "arrow theme-twisty";
@@ -1824,47 +1821,47 @@ Scope.prototype = {
     element.appendChild(title);
     element.appendChild(enumerable);
     element.appendChild(nonenum);
   },
 
   /**
    * Adds the necessary event listeners for this scope.
    */
-  _addEventListeners: function () {
+  _addEventListeners: function() {
     this._title.addEventListener("mousedown", this._onClick);
   },
 
   /**
    * The click listener for this scope's title.
    */
-  _onClick: function (e) {
+  _onClick: function(e) {
     if (this.editing ||
         e.button != 0 ||
         e.target == this._editNode ||
         e.target == this._deleteNode ||
         e.target == this._addPropertyNode) {
       return;
     }
     this.toggle();
     this.focus();
   },
 
   /**
    * Opens the enumerable items container.
    */
-  _openEnum: function () {
+  _openEnum: function() {
     this._arrow.setAttribute("open", "");
     this._enum.setAttribute("open", "");
   },
 
   /**
    * Opens the non-enumerable items container.
    */
-  _openNonEnum: function () {
+  _openNonEnum: function() {
     this._nonenum.setAttribute("open", "");
   },
 
   /**
    * Specifies if enumerable properties and variables should be displayed.
    * @param boolean aFlag
    */
   set _enumVisible(aFlag) {
@@ -1903,17 +1900,17 @@ Scope.prototype = {
 
   /**
    * Performs a case insensitive search for variables or properties matching
    * the query, and hides non-matched items.
    *
    * @param string aLowerCaseQuery
    *        The lowercased name of the variable or property to search for.
    */
-  _performSearch: function (aLowerCaseQuery) {
+  _performSearch: function(aLowerCaseQuery) {
     for (let [, variable] of this._store) {
       let currentObject = variable;
       let lowerCaseName = variable._nameString.toLowerCase();
       let lowerCaseValue = variable._valueString.toLowerCase();
 
       // Non-matched variables or properties require a corresponding attribute.
       if (!lowerCaseName.includes(aLowerCaseQuery) &&
           !lowerCaseValue.includes(aLowerCaseQuery)) {
@@ -1970,17 +1967,17 @@ Scope.prototype = {
    * the non-enumerable children (since they are presented in separate groups).
    *
    * @param function aPredicate
    *        A function that returns true when a match is found.
    * @return Scope | Variable | Property
    *         The first visible scope, variable or property, or null if nothing
    *         is found.
    */
-  _findInVisibleItems: function (aPredicate) {
+  _findInVisibleItems: function(aPredicate) {
     if (aPredicate(this)) {
       return this;
     }
 
     if (this._isExpanded) {
       if (this._variablesView._enumVisible) {
         for (let item of this._enumItems) {
           let result = item._findInVisibleItems(aPredicate);
@@ -2011,17 +2008,17 @@ Scope.prototype = {
    * finally tests itself.
    *
    * @param function aPredicate
    *        A function that returns true when a match is found.
    * @return Scope | Variable | Property
    *         The last visible scope, variable or property, or null if nothing
    *         is found.
    */
-  _findInVisibleItemsReverse: function (aPredicate) {
+  _findInVisibleItemsReverse: function(aPredicate) {
     if (this._isExpanded) {
       if (this._variablesView._nonEnumVisible) {
         for (let i = this._nonEnumItems.length - 1; i >= 0; i--) {
           let item = this._nonEnumItems[i];
           let result = item._findInVisibleItemsReverse(aPredicate);
           if (result) {
             return result;
           }
@@ -2194,24 +2191,24 @@ Variable.prototype = extend(Scope.protot
    *        The name of the new Property.
    * @param object aDescriptor
    *        The property's descriptor.
    * @param object aOptions
    *        Options of the form accepted by Scope.addItem
    * @return Property
    *         The newly created child Property.
    */
-  _createChild: function (aName, aDescriptor, aOptions) {
+  _createChild: function(aName, aDescriptor, aOptions) {
     return new Property(this, aName, aDescriptor, aOptions);
   },
 
   /**
    * Remove this Variable from its parent and remove all children recursively.
    */
-  remove: function () {
+  remove: function() {
     if (this._linkedToInspector) {
       this.unhighlightDomNode();
       this._valueLabel.removeEventListener("mouseover", this.highlightDomNode);
       this._valueLabel.removeEventListener("mouseout", this.unhighlightDomNode);
       this._openInspectorNode.removeEventListener("mousedown", this.openNodeInInspector);
     }
 
     this.ownerView._store.delete(this._nameString);
@@ -2230,17 +2227,17 @@ Variable.prototype = extend(Scope.protot
    *
    * @param object aObject
    *        The raw object you want to display.
    * @param object aOptions [optional]
    *        Additional options for adding the properties. Supported options:
    *        - sorted: true to sort all the properties before adding them
    *        - expanded: true to expand all the properties after adding them
    */
-  populate: function (aObject, aOptions = {}) {
+  populate: function(aObject, aOptions = {}) {
     // Retrieve the properties only once.
     if (this._fetched) {
       return;
     }
     this._fetched = true;
 
     let propertyNames = Object.getOwnPropertyNames(aObject);
     let prototype = Object.getPrototypeOf(aObject);
@@ -2276,34 +2273,34 @@ Variable.prototype = extend(Scope.protot
    * properties of an object
    *
    * @param Variable | Property aVar
    *        The target variable to populate.
    * @param object aObject [optional]
    *        The raw object you want to display. If unspecified, the object is
    *        assumed to be defined in a _sourceValue property on the target.
    */
-  _populateTarget: function (aVar, aObject = aVar._sourceValue) {
+  _populateTarget: function(aVar, aObject = aVar._sourceValue) {
     aVar.populate(aObject);
   },
 
   /**
    * Adds a property for this variable based on a raw value descriptor.
    *
    * @param string aName
    *        The property's name.
    * @param object aDescriptor
    *        Specifies the exact property descriptor as returned by a call to
    *        Object.getOwnPropertyDescriptor.
    * @param object aValue
    *        The raw property value you want to display.
    * @return Property
    *         The newly added property instance.
    */
-  _addRawValueProperty: function (aName, aDescriptor, aValue) {
+  _addRawValueProperty: function(aName, aDescriptor, aValue) {
     let descriptor = Object.create(aDescriptor);
     descriptor.value = VariablesView.getGrip(aValue);
 
     let propertyItem = this.addItem(aName, descriptor);
     propertyItem._sourceValue = aValue;
 
     // Add an 'onexpand' callback for the property, lazily handling
     // the addition of new child properties.
@@ -2319,17 +2316,17 @@ Variable.prototype = extend(Scope.protot
    * @param string aName
    *        The property's name.
    * @param object aDescriptor
    *        Specifies the exact property descriptor as returned by a call to
    *        Object.getOwnPropertyDescriptor.
    * @return Property
    *         The newly added property instance.
    */
-  _addRawNonValueProperty: function (aName, aDescriptor) {
+  _addRawNonValueProperty: function(aName, aDescriptor) {
     let descriptor = Object.create(aDescriptor);
     descriptor.get = VariablesView.getGrip(aDescriptor.get);
     descriptor.set = VariablesView.getGrip(aDescriptor.set);
 
     return this.addItem(aName, descriptor);
   },
 
   /**
@@ -2369,17 +2366,17 @@ Variable.prototype = extend(Scope.protot
   },
 
   /**
    * Build this variable's path to the topmost scope in form of an array of
    * strings, one for each segment of the path.
    * For example, a symbolic path may look like ["0", "foo", "bar"].
    * @return array
    */
-  _buildSymbolicPath: function (path = []) {
+  _buildSymbolicPath: function(path = []) {
     if (this.name) {
       path.unshift(this.name);
       if (this.ownerView instanceof Variable) {
         return this.ownerView._buildSymbolicPath(path);
       }
     }
     return path;
   },
@@ -2420,17 +2417,17 @@ Variable.prototype = extend(Scope.protot
    *        Specifies the value and/or type & class of the variable.
    *        e.g. - 42
    *             - true
    *             - "nasu"
    *             - { type: "undefined" }
    *             - { type: "null" }
    *             - { type: "object", class: "Object" }
    */
-  setGrip: function (aGrip) {
+  setGrip: function(aGrip) {
     // Don't allow displaying grip information if there's no name available
     // or the grip is malformed.
     if (this._nameString === undefined || aGrip === undefined || aGrip === null) {
       return;
     }
     // Getters and setters should display grip information in sub-properties.
     if (this.getter || this.setter) {
       return;
@@ -2440,26 +2437,23 @@ Variable.prototype = extend(Scope.protot
     if (prevGrip) {
       this._valueLabel.classList.remove(VariablesView.getClass(prevGrip));
     }
     this._valueGrip = aGrip;
 
     if (aGrip && (aGrip.optimizedOut || aGrip.uninitialized || aGrip.missingArguments)) {
       if (aGrip.optimizedOut) {
         this._valueString = L10N.getStr("variablesViewOptimizedOut");
-      }
-      else if (aGrip.uninitialized) {
+      } else if (aGrip.uninitialized) {
         this._valueString = L10N.getStr("variablesViewUninitialized");
-      }
-      else if (aGrip.missingArguments) {
+      } else if (aGrip.missingArguments) {
         this._valueString = L10N.getStr("variablesViewMissingArgs");
       }
       this.eval = null;
-    }
-    else {
+    } else {
       this._valueString = VariablesView.getString(aGrip, {
         concise: true,
         noEllipsis: true,
       });
       this.eval = this.ownerView.eval;
     }
 
     this._valueClassName = VariablesView.getClass(aGrip);
@@ -2475,31 +2469,31 @@ Variable.prototype = extend(Scope.protot
   },
 
   /**
    * Marks this variable as overridden.
    *
    * @param boolean aFlag
    *        Whether this variable is overridden or not.
    */
-  setOverridden: function (aFlag) {
+  setOverridden: function(aFlag) {
     if (aFlag) {
       this._target.setAttribute("overridden", "");
     } else {
       this._target.removeAttribute("overridden");
     }
   },
 
   /**
    * Briefly flashes this variable.
    *
    * @param number aDuration [optional]
    *        An optional flash animation duration.
    */
-  flash: function (aDuration = ITEM_FLASH_DURATION) {
+  flash: function(aDuration = ITEM_FLASH_DURATION) {
     let fadeInDelay = this._variablesView.lazyEmptyDelay + 1;
     let fadeOutDelay = fadeInDelay + aDuration;
 
     setNamedTimeout("vview-flash-in" + this.absoluteName,
       fadeInDelay, () => this._target.setAttribute("changed", ""));
 
     setNamedTimeout("vview-flash-out" + this.absoluteName,
       fadeOutDelay, () => this._target.removeAttribute("changed"));
@@ -2508,17 +2502,17 @@ Variable.prototype = extend(Scope.protot
   /**
    * Initializes this variable's id, view and binds event listeners.
    *
    * @param string aName
    *        The variable's name.
    * @param object aDescriptor
    *        The variable's descriptor.
    */
-  _init: function (aName, aDescriptor) {
+  _init: function(aName, aDescriptor) {
     this._idString = generateId(this._nameString = aName);
     this._displayScope(aName, this.targetClassName);
     this._displayVariable();
     this._customizeVariable();
     this._prepareTooltips();
     this._setAttributes();
     this._addEventListeners();
 
@@ -2531,17 +2525,17 @@ Variable.prototype = extend(Scope.protot
       this.ownerView._nonenum.appendChild(this._target);
       this.ownerView._nonEnumItems.push(this);
     }
   },
 
   /**
    * Creates the necessary nodes for this variable.
    */
-  _displayVariable: function () {
+  _displayVariable: function() {
     let document = this.document;
     let descriptor = this._initialDescriptor;
 
     let separatorLabel = this._separatorLabel = document.createElement("label");
     separatorLabel.className = "plain separator";
     separatorLabel.setAttribute("value", this.separatorStr + " ");
 
     let valueLabel = this._valueLabel = document.createElement("label");
@@ -2592,17 +2586,17 @@ Variable.prototype = extend(Scope.protot
       setter.hideArrow();
       this.expand();
     }
   },
 
   /**
    * Adds specific nodes for this variable based on custom flags.
    */
-  _customizeVariable: function () {
+  _customizeVariable: function() {
     let ownerView = this.ownerView;
     let descriptor = this._initialDescriptor;
 
     if (ownerView.eval && this.getter || this.setter) {
       let editNode = this._editNode = this.document.createElement("toolbarbutton");
       editNode.className = "plain variables-view-edit";
       editNode.addEventListener("mousedown", this._onEdit.bind(this));
       this._title.insertBefore(editNode, this._spacer);
@@ -2664,24 +2658,24 @@ Variable.prototype = extend(Scope.protot
         this._title.appendChild(nonExtensibleLabel);
       }
     }
   },
 
   /**
    * Prepares all tooltips for this variable.
    */
-  _prepareTooltips: function () {
+  _prepareTooltips: function() {
     this._target.addEventListener("mouseover", this._setTooltips);
   },
 
   /**
    * Sets all tooltips for this variable.
    */
-  _setTooltips: function () {
+  _setTooltips: function() {
     this._target.removeEventListener("mouseover", this._setTooltips);
 
     let ownerView = this.ownerView;
     if (ownerView.preventDescriptorModifiers) {
       return;
     }
 
     let tooltip = this.document.createElement("tooltip");
@@ -2726,29 +2720,29 @@ Variable.prototype = extend(Scope.protot
     return this._variablesView.toolbox;
   },
 
   /**
    * Checks if this variable is a DOMNode and is part of a variablesview that
    * has been linked to the toolbox, so that highlighting and jumping to the
    * inspector can be done.
    */
-  _isLinkableToInspector: function () {
+  _isLinkableToInspector: function() {
     let isDomNode = this._valueGrip && this._valueGrip.preview.kind === "DOMNode";
     let hasBeenLinked = this._linkedToInspector;
     let hasToolbox = !!this.toolbox;
 
     return isDomNode && !hasBeenLinked && hasToolbox;
   },
 
   /**
    * If the variable is a DOMNode, and if a toolbox is set, then link it to the
    * inspector (highlight on hover, and jump to markup-view on click)
    */
-  _linkToInspector: function () {
+  _linkToInspector: function() {
     if (!this._isLinkableToInspector()) {
       return;
     }
 
     // Listen to value mouseover/click events to highlight and jump
     this._valueLabel.addEventListener("mouseover", this.highlightDomNode);
     this._valueLabel.addEventListener("mouseout", this.unhighlightDomNode);
 
@@ -2763,24 +2757,24 @@ Variable.prototype = extend(Scope.protot
 
   /**
    * In case this variable is a DOMNode and part of a variablesview that has been
    * linked to the toolbox's inspector, then select the corresponding node in
    * the inspector, and switch the inspector tool in the toolbox
    * @return a promise that resolves when the node is selected and the inspector
    * has been switched to and is ready
    */
-  openNodeInInspector: function (event) {
+  openNodeInInspector: function(event) {
     if (!this.toolbox) {
       return promise.reject(new Error("Toolbox not available"));
     }
 
     event && event.stopPropagation();
 
-    return (async function () {
+    return (async function() {
       await this.toolbox.initInspector();
 
       let nodeFront = this._nodeFront;
       if (!nodeFront) {
         nodeFront = await this.toolbox.walker.getNodeActorFromObjectActor(this._valueGrip.actor);
       }
 
       if (nodeFront) {
@@ -2793,17 +2787,17 @@ Variable.prototype = extend(Scope.protot
       }
     }.bind(this))();
   },
 
   /**
    * In case this variable is a DOMNode and part of a variablesview that has been
    * linked to the toolbox's inspector, then highlight the corresponding node
    */
-  highlightDomNode: function () {
+  highlightDomNode: function() {
     if (this.toolbox) {
       if (this._nodeFront) {
         // If the nodeFront has been retrieved before, no need to ask the server
         // again for it
         this.toolbox.highlighterUtils.highlightNodeFront(this._nodeFront);
         return;
       }
 
@@ -2812,28 +2806,28 @@ Variable.prototype = extend(Scope.protot
       });
     }
   },
 
   /**
    * Unhighlight a previously highlit node
    * @see highlightDomNode
    */
-  unhighlightDomNode: function () {
+  unhighlightDomNode: function() {
     if (this.toolbox) {
       this.toolbox.highlighterUtils.unhighlight();
     }
   },
 
   /**
    * Sets a variable's configurable, enumerable and writable attributes,
    * and specifies if it's a 'this', '<exception>', '<return>' or '__proto__'
    * reference.
    */
-  _setAttributes: function () {
+  _setAttributes: function() {
     let ownerView = this.ownerView;
     if (ownerView.preventDescriptorModifiers) {
       return;
     }
 
     let descriptor = this._initialDescriptor;
     let target = this._target;
     let name = this._nameString;
@@ -2865,48 +2859,45 @@ Variable.prototype = extend(Scope.protot
     }
 
     if (descriptor && "getterValue" in descriptor) {
       target.setAttribute("safe-getter", "");
     }
 
     if (name == "this") {
       target.setAttribute("self", "");
-    }
-    else if (this._internalItem && name == "<exception>") {
+    } else if (this._internalItem && name == "<exception>") {
       target.setAttribute("exception", "");
       target.setAttribute("pseudo-item", "");
-    }
-    else if (this._internalItem && name == "<return>") {
+    } else if (this._internalItem && name == "<return>") {
       target.setAttribute("return", "");
       target.setAttribute("pseudo-item", "");
-    }
-    else if (name == "__proto__") {
+    } else if (name == "__proto__") {
       target.setAttribute("proto", "");
       target.setAttribute("pseudo-item", "");
     }
 
     if (Object.keys(descriptor).length == 0) {
       target.setAttribute("pseudo-item", "");
     }
   },
 
   /**
    * Adds the necessary event listeners for this variable.
    */
-  _addEventListeners: function () {
+  _addEventListeners: function() {
     this._name.addEventListener("dblclick", this._activateNameInput);
     this._valueLabel.addEventListener("mousedown", this._activateValueInput);
     this._title.addEventListener("mousedown", this._onClick);
   },
 
   /**
    * Makes this variable's name editable.
    */
-  _activateNameInput: function (e) {
+  _activateNameInput: function(e) {
     if (!this._variablesView.alignedValues) {
       this._separatorLabel.hidden = true;
       this._valueLabel.hidden = true;
     }
 
     EditableName.create(this, {
       onSave: aKey => {
         if (!this._variablesView.preventDisableOnChange) {
@@ -2921,34 +2912,34 @@ Variable.prototype = extend(Scope.protot
         }
       }
     }, e);
   },
 
   /**
    * Makes this variable's value editable.
    */
-  _activateValueInput: function (e) {
+  _activateValueInput: function(e) {
     EditableValue.create(this, {
       onSave: aString => {
         if (this._linkedToInspector) {
           this.unhighlightDomNode();
         }
         if (!this._variablesView.preventDisableOnChange) {
           this._disable();
         }
         this.ownerView.eval(this, aString);
       }
     }, e);
   },
 
   /**
    * Disables this variable prior to a new name switch or value evaluation.
    */
-  _disable: function () {
+  _disable: function() {
     // Prevent the variable from being collapsed or expanded.
     this.hideArrow();
 
     // Hide any nodes that may offer information about the variable.
     for (let node of this._title.childNodes) {
       node.hidden = node != this._arrow && node != this._name;
     }
     this._enum.hidden = true;
@@ -2959,30 +2950,30 @@ Variable.prototype = extend(Scope.protot
    * The current macro used to generate the string evaluated when performing
    * a variable or property value change.
    */
   evaluationMacro: VariablesView.simpleValueEvalMacro,
 
   /**
    * The click listener for the edit button.
    */
-  _onEdit: function (e) {
+  _onEdit: function(e) {
     if (e.button != 0) {
       return;
     }
 
     e.preventDefault();
     e.stopPropagation();
     this._activateValueInput();
   },
 
   /**
    * The click listener for the delete button.
    */
-  _onDelete: function (e) {
+  _onDelete: function(e) {
     if ("button" in e && e.button != 0) {
       return;
     }
 
     e.preventDefault();
     e.stopPropagation();
 
     if (this.ownerView.delete) {
@@ -2990,17 +2981,17 @@ Variable.prototype = extend(Scope.protot
         this.hide();
       }
     }
   },
 
   /**
    * The click listener for the add property button.
    */
-  _onAddProperty: function (e) {
+  _onAddProperty: function(e) {
     if ("button" in e && e.button != 0) {
       return;
     }
 
     e.preventDefault();
     e.stopPropagation();
 
     this.expanded = true;
@@ -3102,31 +3093,31 @@ Variable.prototype[Symbol.iterator] =
 Property.prototype[Symbol.iterator] = function* () {
   yield* this._store;
 };
 
 /**
  * Forget everything recorded about added scopes, variables or properties.
  * @see VariablesView.commitHierarchy
  */
-VariablesView.prototype.clearHierarchy = function () {
+VariablesView.prototype.clearHierarchy = function() {
   this._prevHierarchy.clear();
   this._currHierarchy.clear();
 };
 
 /**
  * Perform operations on all the VariablesView Scopes, Variables and Properties
  * after you've added all the items you wanted.
  *
  * Calling this method is optional, and does the following:
  *   - styles the items overridden by other items in parent scopes
  *   - reopens the items which were previously expanded
  *   - flashes the items whose values changed
  */
-VariablesView.prototype.commitHierarchy = function () {
+VariablesView.prototype.commitHierarchy = function() {
   for (let [, currItem] of this._currHierarchy) {
     // Avoid performing expensive operations.
     if (this.commitHierarchyIgnoredItems[currItem._nameString]) {
       continue;
     }
     let overridden = this.isOverridden(currItem);
     if (overridden) {
       currItem.setOverridden(true);
@@ -3157,34 +3148,34 @@ VariablesView.prototype.commitHierarchyI
  * Checks if the an item was previously expanded, if it existed in a
  * previous hierarchy.
  *
  * @param Scope | Variable | Property aItem
  *        The item to verify.
  * @return boolean
  *         Whether the item was expanded.
  */
-VariablesView.prototype.wasExpanded = function (aItem) {
+VariablesView.prototype.wasExpanded = function(aItem) {
   if (!(aItem instanceof Scope)) {
     return false;
   }
   let prevItem = this._prevHierarchy.get(aItem.absoluteName || aItem._nameString);
   return prevItem ? prevItem._isExpanded : false;
 };
 
 /**
  * Checks if the an item's displayed value (a representation of the grip)
  * has changed, if it existed in a previous hierarchy.
  *
  * @param Variable | Property aItem
  *        The item to verify.
  * @return boolean
  *         Whether the item has changed.
  */
-VariablesView.prototype.hasChanged = function (aItem) {
+VariablesView.prototype.hasChanged = function(aItem) {
   // Only analyze Variables and Properties for displayed value changes.
   // Scopes are just collections of Variables and Properties and
   // don't have a "value", so they can't change.
   if (!(aItem instanceof Variable)) {
     return false;
   }
   let prevItem = this._prevHierarchy.get(aItem.absoluteName);
   return prevItem ? prevItem._valueString != aItem._valueString : false;
@@ -3194,17 +3185,17 @@ VariablesView.prototype.hasChanged = fun
  * Checks if the an item was previously expanded, if it existed in a
  * previous hierarchy.
  *
  * @param Scope | Variable | Property aItem
  *        The item to verify.
  * @return boolean
  *         Whether the item was expanded.
  */
-VariablesView.prototype.isOverridden = function (aItem) {
+VariablesView.prototype.isOverridden = function(aItem) {
   // Only analyze Variables for being overridden in different Scopes.
   if (!(aItem instanceof Variable) || aItem instanceof Property) {
     return false;
   }
   let currVariableName = aItem._nameString;
   let parentScopes = this.getParentScopesForVariableOrProperty(aItem);
 
   for (let otherScope of parentScopes) {
@@ -3219,17 +3210,17 @@ VariablesView.prototype.isOverridden = f
 
 /**
  * Returns true if the descriptor represents an undefined, null or
  * primitive value.
  *
  * @param object aDescriptor
  *        The variable's descriptor.
  */
-VariablesView.isPrimitive = function (aDescriptor) {
+VariablesView.isPrimitive = function(aDescriptor) {
   // For accessor property descriptors, the getter and setter need to be
   // contained in 'get' and 'set' properties.
   let getter = aDescriptor.get;
   let setter = aDescriptor.set;
   if (getter || setter) {
     return false;
   }
 
@@ -3258,17 +3249,17 @@ VariablesView.isPrimitive = function (aD
 };
 
 /**
  * Returns true if the descriptor represents an undefined value.
  *
  * @param object aDescriptor
  *        The variable's descriptor.
  */
-VariablesView.isUndefined = function (aDescriptor) {
+VariablesView.isUndefined = function(aDescriptor) {
   // For accessor property descriptors, the getter and setter need to be
   // contained in 'get' and 'set' properties.
   let getter = aDescriptor.get;
   let setter = aDescriptor.set;
   if (typeof getter == "object" && getter.type == "undefined" &&
       typeof setter == "object" && setter.type == "undefined") {
     return true;
   }
@@ -3284,17 +3275,17 @@ VariablesView.isUndefined = function (aD
 };
 
 /**
  * Returns true if the descriptor represents a falsy value.
  *
  * @param object aDescriptor
  *        The variable's descriptor.
  */
-VariablesView.isFalsy = function (aDescriptor) {
+VariablesView.isFalsy = function(aDescriptor) {
   // As described in the remote debugger protocol, the value grip
   // must be contained in a 'value' property.
   let grip = aDescriptor.value;
   if (typeof grip != "object") {
     return !grip;
   }
 
   // For convenience, undefined, null, NaN, and -0 are all considered types.
@@ -3310,29 +3301,29 @@ VariablesView.isFalsy = function (aDescr
 };
 
 /**
  * Returns true if the value is an instance of Variable or Property.
  *
  * @param any aValue
  *        The value to test.
  */
-VariablesView.isVariable = function (aValue) {
+VariablesView.isVariable = function(aValue) {
   return aValue instanceof Variable;
 };
 
 /**
  * Returns a standard grip for a value.
  *
  * @param any aValue
  *        The raw value to get a grip for.
  * @return any
  *         The value's grip.
  */
-VariablesView.getGrip = function (aValue) {
+VariablesView.getGrip = function(aValue) {
   switch (typeof aValue) {
     case "boolean":
     case "string":
       return aValue;
     case "number":
       if (aValue === Infinity) {
         return { type: "Infinity" };
       } else if (aValue === -Infinity) {
@@ -3371,17 +3362,17 @@ VariablesView.getGrip = function (aValue
  *        Options:
  *        - concise: boolean that tells you want a concisely formatted string.
  *        - noStringQuotes: boolean that tells to not quote strings.
  *        - noEllipsis: boolean that tells to not add an ellipsis after the
  *        initial text of a longString.
  * @return string
  *         The formatted property string.
  */
-VariablesView.getString = function (aGrip, aOptions = {}) {
+VariablesView.getString = function(aGrip, aOptions = {}) {
   if (aGrip && typeof aGrip == "object") {
     switch (aGrip.type) {
       case "undefined":
       case "null":
       case "NaN":
       case "Infinity":
       case "-Infinity":
       case "-0":
@@ -3429,116 +3420,116 @@ VariablesView.getString = function (aGri
  *
  * Any stringifier function must return a string. If null is returned, * then
  * the default stringifier will be used. When invoked, the stringifier is
  * given the same two arguments as those given to VariablesView.getString().
  */
 VariablesView.stringifiers = {};
 
 VariablesView.stringifiers.byType = {
-  string: function (aGrip, {noStringQuotes}) {
+  string: function(aGrip, {noStringQuotes}) {
     if (noStringQuotes) {
       return aGrip;
     }
     return '"' + aGrip + '"';
   },
 
-  longString: function ({initial}, {noStringQuotes, noEllipsis}) {
+  longString: function({initial}, {noStringQuotes, noEllipsis}) {
     let ellipsis = noEllipsis ? "" : ELLIPSIS;
     if (noStringQuotes) {
       return initial + ellipsis;
     }
     let result = '"' + initial + '"';
     if (!ellipsis) {
       return result;
     }
     return result.substr(0, result.length - 1) + ellipsis + '"';
   },
 
-  object: function (aGrip, aOptions) {
+  object: function(aGrip, aOptions) {
     let {preview} = aGrip;
     let stringifier;
     if (aGrip.class) {
       stringifier = VariablesView.stringifiers.byObjectClass[aGrip.class];
     }
     if (!stringifier && preview && preview.kind) {
       stringifier = VariablesView.stringifiers.byObjectKind[preview.kind];
     }
     if (stringifier) {
       return stringifier(aGrip, aOptions);
     }
     return null;
   },
 
-  symbol: function (aGrip, aOptions) {
+  symbol: function(aGrip, aOptions) {
     const name = aGrip.name || "";
     return "Symbol(" + name + ")";
   },
 
-  mapEntry: function (aGrip, {concise}) {
+  mapEntry: function(aGrip, {concise}) {
     let { preview: { key, value }} = aGrip;
 
     let keyString = VariablesView.getString(key, {
       concise: true,
       noStringQuotes: true,
     });
     let valueString = VariablesView.getString(value, { concise: true });
 
     return keyString + " \u2192 " + valueString;
   },
 
 }; // VariablesView.stringifiers.byType
 
 VariablesView.stringifiers.byObjectClass = {
-  Function: function (aGrip, {concise}) {
+  Function: function(aGrip, {concise}) {
     // TODO: Bug 948484 - support arrow functions and ES6 generators
 
     let name = aGrip.userDisplayName || aGrip.displayName || aGrip.name || "";
     name = VariablesView.getString(name, { noStringQuotes: true });
 
     // TODO: Bug 948489 - Support functions with destructured parameters and
     // rest parameters
     let params = aGrip.parameterNames || "";
     if (!concise) {
       return "function " + name + "(" + params + ")";
     }
     return (name || "function ") + "(" + params + ")";
   },
 
-  RegExp: function ({displayString}) {
+  RegExp: function({displayString}) {
     return VariablesView.getString(displayString, { noStringQuotes: true });
   },
 
-  Date: function ({preview}) {
+  Date: function({preview}) {
     if (!preview || !("timestamp" in preview)) {
       return null;
     }
 
     if (typeof preview.timestamp != "number") {
       return new Date(preview.timestamp).toString(); // invalid date
     }
 
     return "Date " + new Date(preview.timestamp).toISOString();
   },
 
-  Number: function (aGrip) {
+  Number: function(aGrip) {
     let {preview} = aGrip;
     if (preview === undefined) {
       return null;
     }
     return aGrip.class + " { " + VariablesView.getString(preview.wrappedValue) +
       " }";
   },
 }; // VariablesView.stringifiers.byObjectClass
 
 VariablesView.stringifiers.byObjectClass.Boolean =
   VariablesView.stringifiers.byObjectClass.Number;
 
 VariablesView.stringifiers.byObjectKind = {
-  ArrayLike: function (aGrip, {concise}) {
+  ArrayLike: function(aGrip, {concise}) {
     let {preview} = aGrip;
     if (concise) {
       return aGrip.class + "[" + preview.length + "]";
     }
 
     if (!preview.items) {
       return null;
     }
@@ -3566,17 +3557,17 @@ VariablesView.stringifiers.byObjectKind 
       // make sure we have the right number of commas...
       result[lastHole] += ",";
     }
 
     let prefix = aGrip.class == "Array" ? "" : aGrip.class + " ";
     return prefix + "[" + result.join(", ") + "]";
   },
 
-  MapLike: function (aGrip, {concise}) {
+  MapLike: function(aGrip, {concise}) {
     let {preview} = aGrip;
     if (concise || !preview.entries) {
       let size = typeof preview.size == "number" ?
                    "[" + preview.size + "]" : "";
       return aGrip.class + size;
     }
 
     let entries = [];
@@ -3592,35 +3583,35 @@ VariablesView.stringifiers.byObjectKind 
     if (typeof preview.size == "number" && preview.size > entries.length) {
       let n = preview.size - entries.length;
       entries.push(VariablesView.stringifiers._getNMoreString(n));
     }
 
     return aGrip.class + " {" + entries.join(", ") + "}";
   },
 
-  ObjectWithText: function (aGrip, {concise}) {
+  ObjectWithText: function(aGrip, {concise}) {
     if (concise) {
       return aGrip.class;
     }
 
     return aGrip.class + " " + VariablesView.getString(aGrip.preview.text);
   },
 
-  ObjectWithURL: function (aGrip, {concise}) {
+  ObjectWithURL: function(aGrip, {concise}) {
     let result = aGrip.class;
     let url = aGrip.preview.url;
     if (!VariablesView.isFalsy({ value: url })) {
       result += ` \u2192 ${getSourceNames(url)[concise ? "short" : "long"]}`;
     }
     return result;
   },
 
   // Stringifier for any kind of object.
-  Object: function (aGrip, {concise}) {
+  Object: function(aGrip, {concise}) {
     if (concise) {
       return aGrip.class;
     }
 
     let {preview} = aGrip;
     let props = [];
 
     if (aGrip.class == "Promise" && aGrip.promiseState) {
@@ -3664,17 +3655,17 @@ VariablesView.stringifiers.byObjectKind 
         props.push(VariablesView.stringifiers._getNMoreString(diff));
       }
     }
 
     let prefix = aGrip.class != "Object" ? aGrip.class + " " : "";
     return prefix + "{" + props.join(", ") + "}";
   }, // Object
 
-  Error: function (aGrip, {concise}) {
+  Error: function(aGrip, {concise}) {
     let {preview} = aGrip;
     let name = VariablesView.getString(preview.name, { noStringQuotes: true });
     if (concise) {
       return name || aGrip.class;
     }
 
     let msg = name + ": " +
               VariablesView.getString(preview.message, { noStringQuotes: true });
@@ -3682,17 +3673,17 @@ VariablesView.stringifiers.byObjectKind 
     if (!VariablesView.isFalsy({ value: preview.stack })) {
       msg += "\n" + L10N.getStr("variablesViewErrorStacktrace") +
              "\n" + preview.stack;
     }
 
     return msg;
   },
 
-  DOMException: function (aGrip, {concise}) {
+  DOMException: function(aGrip, {concise}) {
     let {preview} = aGrip;
     if (concise) {
       return preview.name || aGrip.class;
     }
 
     let msg = aGrip.class + " [" + preview.name + ": " +
               VariablesView.getString(preview.message) + "\n" +
               "code: " + preview.code + "\n" +
@@ -3703,17 +3694,17 @@ VariablesView.stringifiers.byObjectKind 
       if (preview.lineNumber) {
         msg += ":" + preview.lineNumber;
       }
     }
 
     return msg + "]";
   },
 
-  DOMEvent: function (aGrip, {concise}) {
+  DOMEvent: function(aGrip, {concise}) {
     let {preview} = aGrip;
     if (!preview.type) {
       return null;
     }
 
     if (concise) {
       return aGrip.class + " " + preview.type;
     }
@@ -3734,17 +3725,17 @@ VariablesView.stringifiers.byObjectKind 
     for (let prop in preview.properties) {
       let value = preview.properties[prop];
       props.push(prop + ": " + VariablesView.getString(value, { concise: true }));
     }
 
     return result + " {" + props.join(", ") + "}";
   }, // DOMEvent
 
-  DOMNode: function (aGrip, {concise}) {
+  DOMNode: function(aGrip, {concise}) {
     let {preview} = aGrip;
 
     switch (preview.nodeType) {
       case nodeConstants.DOCUMENT_NODE: {
         let result = aGrip.class;
         if (preview.location) {
           result += ` \u2192 ${getSourceNames(preview.location)[concise ? "short" : "long"]}`;
         }
@@ -3810,39 +3801,38 @@ VariablesView.stringifiers.byObjectKind 
       }
 
       default:
         return null;
     }
   }, // DOMNode
 }; // VariablesView.stringifiers.byObjectKind
 
-
 /**
  * Get the "N moreā€¦" formatted string, given an N. This is used for displaying
  * how many elements are not displayed in an object preview (eg. an array).
  *
  * @private
  * @param number aNumber
  * @return string
  */
-VariablesView.stringifiers._getNMoreString = function (aNumber) {
+VariablesView.stringifiers._getNMoreString = function(aNumber) {
   let str = L10N.getStr("variablesViewMoreObjects");
   return PluralForm.get(aNumber, str).replace("#1", aNumber);
 };
 
 /**
  * Returns a custom class style for a grip.
  *
  * @param any aGrip
  *        @see Variable.setGrip
  * @return string
  *         The custom class style.
  */
-VariablesView.getClass = function (aGrip) {
+VariablesView.getClass = function(aGrip) {
   if (aGrip && typeof aGrip == "object") {
     if (aGrip.preview) {
       switch (aGrip.preview.kind) {
         case "DOMNode":
           return "token-domnode";
       }
     }
 
@@ -3876,19 +3866,19 @@ VariablesView.getClass = function (aGrip
  * A monotonically-increasing counter, that guarantees the uniqueness of scope,
  * variables and properties ids.
  *
  * @param string aName
  *        An optional string to prefix the id with.
  * @return number
  *         A unique id.
  */
-var generateId = (function () {
+var generateId = (function() {
   let count = 0;
-  return function (aName = "") {
+  return function(aName = "") {
     return aName.toLowerCase().trim().replace(/\s+/g, "-") + (++count);
   };
 })();
 
 /**
  * Quote and escape a string. The result will be another string containing an
  * ECMAScript StringLiteral which will produce the original one when evaluated
  * by `eval` or similar.
@@ -3898,18 +3888,18 @@ var generateId = (function () {
  *       returns an empty string.
  * @return string
  */
 function escapeString(aString) {
   if (typeof aString !== "string") {
     return "";
   }
   // U+2028 and U+2029 are allowed in JSON but not in ECMAScript string literals.
-  return JSON.stringify(aString).replace(/\u2028/g, '\\u2028')
-                                .replace(/\u2029/g, '\\u2029');
+  return JSON.stringify(aString).replace(/\u2028/g, "\\u2028")
+                                .replace(/\u2029/g, "\\u2029");
 }
 
 /**
  * Escape some HTML special characters. We do not need full HTML serialization
  * here, we just want to make strings safe to display in HTML attributes, for
  * the stringifiers.
  *
  * @param string aString
@@ -3917,17 +3907,16 @@ function escapeString(aString) {
  */
 function escapeHTML(aString) {
   return aString.replace(/&/g, "&amp;")
                 .replace(/"/g, "&quot;")
                 .replace(/</g, "&lt;")
                 .replace(/>/g, "&gt;");
 }
 
-
 /**
  * An Editable encapsulates the UI of an edit box that overlays a label,
  * allowing the user to edit the value.
  *
  * @param Variable aVariable
  *        The Variable or Property to make editable.
  * @param object aOptions
  *        - onSave
@@ -3936,17 +3925,17 @@ function escapeHTML(aString) {
  *          The callback to call when the editable is removed for any reason.
  */
 function Editable(aVariable, aOptions) {
   this._variable = aVariable;
   this._onSave = aOptions.onSave;
   this._onCleanup = aOptions.onCleanup;
 }
 
-Editable.create = function (aVariable, aOptions, aEvent) {
+Editable.create = function(aVariable, aOptions, aEvent) {
   let editable = new this(aVariable, aOptions);
   editable.activate(aEvent);
   return editable;
 };
 
 Editable.prototype = {
   /**
    * The class name for targeting this Editable type's label element. Overridden
@@ -3967,17 +3956,17 @@ Editable.prototype = {
 
   /**
    * Activate this editable by replacing the input box it overlays and
    * initialize the handlers.
    *
    * @param Event e [optional]
    *        Optionally, the Event object that was used to activate the Editable.
    */
-  activate: function (e) {
+  activate: function(e) {
     if (!this.shouldActivate) {
       this._onCleanup && this._onCleanup();
       return;
     }
 
     let { label } = this;
     let initialString = label.getAttribute("value");
 
@@ -4018,17 +4007,17 @@ Editable.prototype = {
     this._variable.locked = true;
     this._variable.editing = true;
   },
 
   /**
    * Remove the input box and restore the Variable or Property to its previous
    * state.
    */
-  deactivate: function () {
+  deactivate: function() {
     this._input.removeEventListener("keydown", this._onKeydown);
     this._input.removeEventListener("blur", this.deactivate);
     this._input.parentNode.replaceChild(this.label, this._input);
     this._input = null;
 
     let { boxObject } = this._variable._variablesView;
     boxObject.scrollBy(-this._variable._target, 0);
     this._variable.locked = false;
@@ -4036,70 +4025,69 @@ Editable.prototype = {
     this._variable.expanded = this._prevExpanded;
     this._variable.editing = false;
     this._onCleanup && this._onCleanup();
   },
 
   /**
    * Save the current value and deactivate the Editable.
    */
-  _save: function () {
+  _save: function() {
     let initial = this.label.getAttribute("value");
     let current = this._input.value.trim();
     this.deactivate();
     if (initial != current) {
       this._onSave(current);
     }
   },
 
   /**
    * Called when tab is pressed, allowing subclasses to link different
    * behavior to tabbing if desired.
    */
-  _next: function () {
+  _next: function() {
     this._save();
   },
 
   /**
    * Called when escape is pressed, indicating a cancelling of editing without
    * saving.
    */
-  _reset: function () {
+  _reset: function() {
     this.deactivate();
     this._variable.focus();
   },
 
   /**
    * Event handler for when the input loses focus.
    */
-  _onBlur: function () {
+  _onBlur: function() {
     this.deactivate();
   },
 
   /**
    * Event handler for when the input receives a key press.
    */
-  _onKeydown: function (e) {
+  _onKeydown: function(e) {
     e.stopPropagation();
 
     switch (e.keyCode) {
       case KeyCodes.DOM_VK_TAB:
         this._next();
         break;
       case KeyCodes.DOM_VK_RETURN:
         this._save();
         break;
       case KeyCodes.DOM_VK_ESCAPE:
         this._reset();
         break;
     }
   },
 };
 
-
 /**
  * An Editable specific to editing the name of a Variable or Property.
  */
 function EditableName(aVariable, aOptions) {
   Editable.call(this, aVariable, aOptions);
 }
 
 EditableName.create = Editable.create;
@@ -4111,17 +4099,16 @@ EditableName.prototype = extend(Editable
     return this._variable._name;
   },
 
   get shouldActivate() {
     return !!this._variable.ownerView.switch;
   },
 });
 
-
 /**
  * An Editable specific to editing the value of a Variable or Property.
  */
 function EditableValue(aVariable, aOptions) {
   Editable.call(this, aVariable, aOptions);
 }
 
 EditableValue.create = Editable.create;
@@ -4133,46 +4120,45 @@ EditableValue.prototype = extend(Editabl
     return this._variable._valueLabel;
   },
 
   get shouldActivate() {
     return !!this._variable.ownerView.eval;
   },
 });
 
-
 /**
  * An Editable specific to editing the key and value of a new property.
  */
 function EditableNameAndValue(aVariable, aOptions) {
   EditableName.call(this, aVariable, aOptions);
 }
 
 EditableNameAndValue.create = Editable.create;
 
 EditableNameAndValue.prototype = extend(EditableName.prototype, {
-  _reset: function (e) {
+  _reset: function(e) {
     // Hide the Variable or Property if the user presses escape.
     this._variable.remove();
     this.deactivate();
   },
 
-  _next: function (e) {
+  _next: function(e) {
     // Override _next so as to set both key and value at the same time.
     let key = this._input.value;
     this.label.setAttribute("value", key);
 
     let valueEditable = EditableValue.create(this._variable, {
       onSave: aValue => {
         this._onSave([key, aValue]);
       }
     });
     valueEditable._reset = () => {
       this._variable.remove();
       valueEditable.deactivate();
     };
   },
 
-  _save: function (e) {
+  _save: function(e) {
     // Both _save and _next activate the value edit box.
     this._next(e);
   }
 });
--- a/devtools/client/shared/widgets/VariablesViewController.jsm
+++ b/devtools/client/shared/widgets/VariablesViewController.jsm
@@ -9,17 +9,17 @@ var {require} = ChromeUtils.import("reso
 var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 var {VariablesView} = require("resource://devtools/client/shared/widgets/VariablesView.jsm");
 var Services = require("Services");
 var promise = require("promise");
 var defer = require("devtools/shared/defer");
 var {LocalizationHelper, ELLIPSIS} = require("devtools/shared/l10n");
 
 Object.defineProperty(this, "WebConsoleUtils", {
-  get: function () {
+  get: function() {
     return require("devtools/client/webconsole/utils").Utils;
   },
   configurable: true,
   enumerable: true
 });
 
 XPCOMUtils.defineLazyGetter(this, "VARIABLES_SORTING_ENABLED", () =>
   Services.prefs.getBoolPref("devtools.debugger.ui.variables-sorting-enabled")
@@ -86,17 +86,17 @@ VariablesViewController.prototype = {
    *
    * @param object aOptions
    *        Options for getting the client grips. Supported options:
    *        - getObjectClient: callback for creating an object grip client
    *        - getLongStringClient: callback for creating a long string grip client
    *        - getEnvironmentClient: callback for creating an environment client
    *        - releaseActor: callback for releasing an actor when it's no longer needed
    */
-  _setClientGetters: function (aOptions) {
+  _setClientGetters: function(aOptions) {
     if (aOptions.getObjectClient) {
       this._getObjectClient = aOptions.getObjectClient;
     }
     if (aOptions.getLongStringClient) {
       this._getLongStringClient = aOptions.getLongStringClient;
     }
     if (aOptions.getEnvironmentClient) {
       this._getEnvironmentClient = aOptions.getEnvironmentClient;
@@ -110,17 +110,17 @@ VariablesViewController.prototype = {
    * Sets the functions used when evaluating strings in the variables view.
    *
    * @param object aOptions
    *        Options for configuring the macros. Supported options:
    *        - overrideValueEvalMacro: callback for creating an overriding eval macro
    *        - getterOrSetterEvalMacro: callback for creating a getter/setter eval macro
    *        - simpleValueEvalMacro: callback for creating a simple value eval macro
    */
-  _setEvaluationMacros: function (aOptions) {
+  _setEvaluationMacros: function(aOptions) {
     if (aOptions.overrideValueEvalMacro) {
       this._overrideValueEvalMacro = aOptions.overrideValueEvalMacro;
     }
     if (aOptions.getterOrSetterEvalMacro) {
       this._getterOrSetterEvalMacro = aOptions.getterOrSetterEvalMacro;
     }
     if (aOptions.simpleValueEvalMacro) {
       this._simpleValueEvalMacro = aOptions.simpleValueEvalMacro;
@@ -132,17 +132,17 @@ VariablesViewController.prototype = {
    *
    * @param Variable aTarget
    *        The target Variable/Property to put the retrieved string into.
    * @param LongStringActor aGrip
    *        The long string grip that use to retrieve the full string.
    * @return Promise
    *         The promise that will be resolved when the string is retrieved.
    */
-  _populateFromLongString: function (aTarget, aGrip) {
+  _populateFromLongString: function(aTarget, aGrip) {
     let deferred = defer();
 
     let from = aGrip.initial.length;
     let to = Math.min(aGrip.length, MAX_LONG_STRING_LENGTH);
 
     this._getLongStringClient(aGrip).substring(from, to, aResponse => {
       // Stop tracking the actor because it's no longer needed.
       this.releaseActor(aGrip);
@@ -162,17 +162,17 @@ VariablesViewController.prototype = {
    * Adds pseudo items in case there is too many properties to display.
    * Each item can expand into property slices.
    *
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aGrip
    *        The property iterator grip.
    */
-  _populatePropertySlices: function (aTarget, aGrip) {
+  _populatePropertySlices: function(aTarget, aGrip) {
     if (aGrip.count < MAX_PROPERTY_ITEMS) {
       return this._populateFromPropertyIterator(aTarget, aGrip);
     }
 
     // Divide the keys into quarters.
     let items = Math.ceil(aGrip.count / 4);
     let iterator = aGrip.propertyIterator;
     let promises = [];
@@ -186,17 +186,17 @@ VariablesViewController.prototype = {
         propertyIterator: iterator,
         start: start,
         count: count
       };
 
       // Query the name of the first and last items for this slice
       let deferred = defer();
       iterator.names([start, start + count - 1], ({ names }) => {
-          let label = "[" + names[0] + ELLIPSIS + names[1] + "]";
+        let label = "[" + names[0] + ELLIPSIS + names[1] + "]";
         let item = aTarget.addItem(label, {}, { internalItem: true });
         item.showArrow();
         this.addExpander(item, sliceGrip);
         deferred.resolve();
       });
       promises.push(deferred.promise);
     }
 
@@ -207,17 +207,17 @@ VariablesViewController.prototype = {
    * Adds a property slice for a Variable in the view using the already
    * property iterator
    *
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aGrip
    *        The property iterator grip.
    */
-  _populateFromPropertyIterator: function (aTarget, aGrip) {
+  _populateFromPropertyIterator: function(aTarget, aGrip) {
     if (aGrip.count >= MAX_PROPERTY_ITEMS) {
       // We already started to split, but there is still too many properties, split again.
       return this._populatePropertySlices(aTarget, aGrip);
     }
     // We started slicing properties, and the slice is now small enough to be displayed
     let deferred = defer();
     aGrip.propertyIterator.slice(aGrip.start, aGrip.count,
       ({ ownProperties }) => {
@@ -240,17 +240,17 @@ VariablesViewController.prototype = {
    *
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aGrip
    *        The grip to use to populate the target.
    * @param string aQuery [optional]
    *        The query string used to fetch only a subset of properties
    */
-  _populateFromObjectWithIterator: function (aTarget, aGrip, aQuery) {
+  _populateFromObjectWithIterator: function(aTarget, aGrip, aQuery) {
     // FF40+ starts exposing `ownPropertyLength` on ObjectActor's grip,
     // as well as `enumProperties` request.
     let deferred = defer();
     let objectClient = this._getObjectClient(aGrip);
     let isArray = aGrip.preview && aGrip.preview.kind === "ArrayLike";
     if (isArray) {
       // First enumerate array items, e.g. properties from `0` to `array.length`.
       let options = {
@@ -289,47 +289,46 @@ VariablesViewController.prototype = {
         let sliceGrip = {
           type: "property-iterator",
           propertyIterator: iterator,
           start: 0,
           count: iterator.count
         };
         deferred.resolve(this._populatePropertySlices(aTarget, sliceGrip));
       });
-
     }
     return deferred.promise;
   },
 
   /**
    * Adds the given prototype in the view.
    *
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aProtype
    *        The prototype grip.
    */
-  _populateObjectPrototype: function (aTarget, aPrototype) {
+  _populateObjectPrototype: function(aTarget, aPrototype) {
     // Add the variable's __proto__.
     if (aPrototype && aPrototype.type != "null") {
       let proto = aTarget.addItem("__proto__", { value: aPrototype });
       this.addExpander(proto, aPrototype);
     }
   },
 
   /**
    * Adds properties to a Scope, Variable, or Property in the view. Triggered
    * when a scope is expanded or certain variables are hovered.
    *
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aGrip
    *        The grip to use to populate the target.
    */
-  _populateFromObject: function (aTarget, aGrip) {
+  _populateFromObject: function(aTarget, aGrip) {
     if (aGrip.class === "Proxy") {
       this.addExpander(
         aTarget.addItem("<target>", { value: aGrip.proxyTarget }, { internalItem: true }),
         aGrip.proxyTarget);
       this.addExpander(
         aTarget.addItem("<handler>", { value: aGrip.proxyHandler }, { internalItem: true }),
         aGrip.proxyHandler);
 
@@ -372,17 +371,17 @@ VariablesViewController.prototype = {
                    });
                    return deferred.promise;
                  });
     }
 
     return this._populateProperties(aTarget, aGrip);
   },
 
-  _populateProperties: function (aTarget, aGrip, aOptions) {
+  _populateProperties: function(aTarget, aGrip, aOptions) {
     let deferred = defer();
 
     let objectClient = this._getObjectClient(aGrip);
     objectClient.getPrototypeAndProperties(aResponse => {
       let ownProperties = aResponse.ownProperties || {};
       let prototype = aResponse.prototype || null;
       // 'safeGetterValues' is new and isn't necessary defined on old actors.
       let safeGetterValues = aResponse.safeGetterValues || {};
@@ -435,17 +434,17 @@ VariablesViewController.prototype = {
   /**
    * Adds the scope chain elements (closures) of a function variable.
    *
    * @param Variable aTarget
    *        The variable where the properties will be placed into.
    * @param Scope aScope
    *        The lexical environment form as specified in the protocol.
    */
-  _populateWithClosure: function (aTarget, aScope) {
+  _populateWithClosure: function(aTarget, aScope) {
     let objectScopes = [];
     let environment = aScope;
     let funcScope = aTarget.addItem("<Closure>");
     funcScope.target.setAttribute("scope", "");
     funcScope.showArrow();
 
     do {
       // Create a scope to contain all the inspected variables.
@@ -478,17 +477,17 @@ VariablesViewController.prototype = {
   /**
    * Adds nodes for every specified binding to the closure node.
    *
    * @param Variable aTarget
    *        The variable where the bindings will be placed into.
    * @param object aBindings
    *        The bindings form as specified in the protocol.
    */
-  _populateWithEnvironmentBindings: function (aTarget, aBindings) {
+  _populateWithEnvironmentBindings: function(aTarget, aBindings) {
     // Add nodes for every argument in the scope.
     aTarget.addItems(aBindings.arguments.reduce((accumulator, arg) => {
       let name = Object.getOwnPropertyNames(arg)[0];
       let descriptor = arg[name];
       accumulator[name] = descriptor;
       return accumulator;
     }, {}), {
       // Arguments aren't sorted.
@@ -501,17 +500,17 @@ VariablesViewController.prototype = {
     aTarget.addItems(aBindings.variables, {
       // Not all variables need to force sorted properties.
       sorted: VARIABLES_SORTING_ENABLED,
       // Expansion handlers must be set after the properties are added.
       callback: this.addExpander
     });
   },
 
-  _populateFromEntries: function (target, grip) {
+  _populateFromEntries: function(target, grip) {
     let objGrip = grip.obj;
     let objectClient = this._getObjectClient(objGrip);
 
     return new promise((resolve, reject) => {
       objectClient.enumEntries((response) => {
         if (response.error) {
           // Older server might not support the enumEntries method
           console.warn(response.error + ": " + response.message);
@@ -534,17 +533,17 @@ VariablesViewController.prototype = {
    * Adds an 'onexpand' callback for a variable, lazily handling
    * the addition of new properties.
    *
    * @param Variable aTarget
    *        The variable where the properties will be placed into.
    * @param any aSource
    *        The source to use to populate the target.
    */
-  addExpander: function (aTarget, aSource) {
+  addExpander: function(aTarget, aSource) {
     // Attach evaluation macros as necessary.
     if (aTarget.getter || aTarget.setter) {
       aTarget.evaluationMacro = this._overrideValueEvalMacro;
       let getter = aTarget.get("get");
       if (getter) {
         getter.evaluationMacro = this._getterOrSetterEvalMacro;
       }
       let setter = aTarget.get("set");
@@ -590,17 +589,17 @@ VariablesViewController.prototype = {
    *
    * @param Scope aTarget
    *        The Scope to be expanded.
    * @param object aSource
    *        The source to use to populate the target.
    * @return Promise
    *         The promise that is resolved once the target has been expanded.
    */
-  populate: function (aTarget, aSource) {
+  populate: function(aTarget, aSource) {
     // Fetch the variables only once.
     if (aTarget._fetched) {
       return aTarget._fetched;
     }
     // Make sure the source grip is available.
     if (!aSource) {
       return promise.reject(new Error("No actor grip was given for the variable."));
     }
@@ -676,57 +675,57 @@ VariablesViewController.prototype = {
     return deferred.promise;
   },
 
   /**
    * Indicates to the view if the targeted actor supports properties search
    *
    * @return boolean True, if the actor supports enumProperty request
    */
-  supportsSearch: function () {
+  supportsSearch: function() {
     // FF40+ starts exposing ownPropertyLength on object actor's grip
     // as well as enumProperty which allows to query a subset of properties.
     return this.objectActor && ("ownPropertyLength" in this.objectActor);
   },
 
   /**
    * Try to use the actor to perform an attribute search.
    *
    * @param Scope aScope
    *        The Scope instance to populate with properties
    * @param string aToken
    *        The query string
    */
-  performSearch: function (aScope, aToken) {
+  performSearch: function(aScope, aToken) {
     this._populateFromObjectWithIterator(aScope, this.objectActor, aToken)
         .then(() => {
           this.view.emit("fetched", "search", aScope);
         });
   },
 
   /**
    * Release an actor from the controller.
    *
    * @param object aActor
    *        The actor to release.
    */
-  releaseActor: function (aActor) {
+  releaseActor: function(aActor) {
     if (this._releaseActor) {
       this._releaseActor(aActor);
     }
     this._actors.delete(aActor);
   },
 
   /**
    * Release all the actors referenced by the controller, optionally filtered.
    *
    * @param function aFilter [optional]
    *        Callback to filter which actors are released.
    */
-  releaseActors: function (aFilter) {
+  releaseActors: function(aFilter) {
     for (let actor of this._actors) {
       if (!aFilter || aFilter(actor)) {
         this.releaseActor(actor);
       }
     }
   },
 
   /**
@@ -744,17 +743,17 @@ VariablesViewController.prototype = {
    *        Additional options for the controller:
    *        - overrideValueEvalMacro: @see _setEvaluationMacros
    *        - getterOrSetterEvalMacro: @see _setEvaluationMacros
    *        - simpleValueEvalMacro: @see _setEvaluationMacros
    * @return Object
    *         - variable: the created Variable.
    *         - expanded: the Promise that resolves when the variable expands.
    */
-  setSingleVariable: function (options, configuration = {}) {
+  setSingleVariable: function(options, configuration = {}) {
     this._setEvaluationMacros(configuration);
     this.view.empty();
 
     let scope = this.view.addScope(options.label);
     scope.expanded = true; // Expand the scope by default.
     scope.locked = true; // Prevent collapsing the scope.
 
     let variable = scope.addItem(undefined, { enumerable: true });
@@ -773,28 +772,27 @@ VariablesViewController.prototype = {
       variable.populate(options.rawObject, { expanded: true });
       populated = promise.resolve();
     }
 
     return { variable: variable, expanded: populated };
   },
 };
 
-
 /**
  * Attaches a VariablesViewController to a VariablesView if it doesn't already
  * have one.
  *
  * @param VariablesView aView
  *        The view to attach to.
  * @param object aOptions
  *        The options to use in creating the controller.
  * @return VariablesViewController
  */
-VariablesViewController.attach = function (aView, aOptions) {
+VariablesViewController.attach = function(aView, aOptions) {
   if (aView.controller) {
     return aView.controller;
   }
   return new VariablesViewController(aView, aOptions);
 };
 
 /**
  * Utility functions for handling stackframes.
@@ -802,33 +800,33 @@ VariablesViewController.attach = functio
 var StackFrameUtils = this.StackFrameUtils = {
   /**
    * Create a textual representation for the specified stack frame
    * to display in the stackframes container.
    *
    * @param object aFrame
    *        The stack frame to label.
    */
-  getFrameTitle: function (aFrame) {
+  getFrameTitle: function(aFrame) {
     if (aFrame.type == "call") {
       let c = aFrame.callee;
       return (c.name || c.userDisplayName || c.displayName || "(anonymous)");
     }
     return "(" + aFrame.type + ")";
   },
 
   /**
    * Constructs a scope label based on its environment.
    *
    * @param object aEnv
    *        The scope's environment.
    * @return string
    *         The scope's label.
    */
-  getScopeLabel: function (aEnv) {
+  getScopeLabel: function(aEnv) {
     let name = "";
 
     // Name the outermost scope Global.
     if (!aEnv.parent) {
       name = L10N.getStr("globalScopeLabel");
     }
     // Otherwise construct the scope name.
     else {