Bug 1326331 - Fix Eslint errors in devtools/shared/heapsnapshot/. r=jryans
authorRuturaj K. Vartak <ruturaj@gmail.com>
Thu, 09 Mar 2017 21:03:00 -0500
changeset 397959 476316fd67e96531868fe416ed7545c757027e8d
parent 397958 addbb183e131e7f3e8b5596b62b50193998578f0
child 397960 e939d2c1a8c146b239769911ec441558ebc9196a
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1326331
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1326331 - Fix Eslint errors in devtools/shared/heapsnapshot/. r=jryans
.eslintignore
devtools/shared/heapsnapshot/CensusUtils.js
devtools/shared/heapsnapshot/DominatorTreeNode.js
devtools/shared/heapsnapshot/HeapAnalysesWorker.js
devtools/shared/heapsnapshot/census-tree-node.js
devtools/shared/heapsnapshot/shortest-paths.js
devtools/shared/heapsnapshot/tests/mochitest/.eslintrc.js
devtools/shared/heapsnapshot/tests/mochitest/test_DominatorTree_01.html
devtools/shared/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html
devtools/shared/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html
devtools/shared/heapsnapshot/tests/unit/Census.jsm
devtools/shared/heapsnapshot/tests/unit/Match.jsm
devtools/shared/heapsnapshot/tests/unit/dominator-tree-worker.js
devtools/shared/heapsnapshot/tests/unit/head_heapsnapshot.js
devtools/shared/heapsnapshot/tests/unit/heap-snapshot-worker.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_01.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_02.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_03.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_04.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_05.js
devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_06.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js
devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js
devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js
devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js
devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js
devtools/shared/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-01.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-02.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-03.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-05.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-06.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-07.js
devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-08.js
devtools/shared/heapsnapshot/tests/unit/test_census_diff_01.js
devtools/shared/heapsnapshot/tests/unit/test_census_diff_02.js
devtools/shared/heapsnapshot/tests/unit/test_census_diff_03.js
devtools/shared/heapsnapshot/tests/unit/test_census_diff_04.js
devtools/shared/heapsnapshot/tests/unit/test_census_diff_05.js
devtools/shared/heapsnapshot/tests/unit/test_census_diff_06.js
devtools/shared/heapsnapshot/tests/unit/test_census_filtering_01.js
devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js
devtools/shared/heapsnapshot/tests/unit/test_census_filtering_03.js
devtools/shared/heapsnapshot/tests/unit/test_census_filtering_04.js
devtools/shared/heapsnapshot/tests/unit/test_census_filtering_05.js
devtools/shared/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js
devtools/shared/heapsnapshot/tests/unit/test_getReportLeaves_01.js
devtools/shared/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -125,17 +125,16 @@ devtools/server/actors/object.js
 devtools/server/actors/script.js
 devtools/server/actors/styleeditor.js
 devtools/server/actors/stylesheets.js
 devtools/server/tests/browser/storage-*.html
 !devtools/server/tests/browser/storage-unsecured-iframe.html
 devtools/server/tests/browser/stylesheets-nested-iframes.html
 devtools/server/tests/mochitest/**
 devtools/server/tests/unit/**
-devtools/shared/heapsnapshot/**
 devtools/shared/platform/content/test/test_clipboard.html
 devtools/shared/qrcode/tests/mochitest/test_decode.html
 devtools/shared/tests/mochitest/*.html
 devtools/shared/webconsole/test/test_*.html
 
 # Ignore devtools pre-processed files
 devtools/client/framework/toolbox-process-window.js
 devtools/client/performance/system.js
--- a/devtools/shared/heapsnapshot/CensusUtils.js
+++ b/devtools/shared/heapsnapshot/CensusUtils.js
@@ -136,18 +136,19 @@ exports.getReportEdges = getReportEdges;
 
 function recursiveWalk(breakdown, edge, report, visitor) {
   if (breakdown.by === "count") {
     visitor.enter(breakdown, report, edge);
     visitor.count(breakdown, report, edge);
     visitor.exit(breakdown, report, edge);
   } else {
     visitor.enter(breakdown, report, edge);
-    for (let { edge, referent, breakdown: subBreakdown } of getReportEdges(breakdown, report)) {
-      recursiveWalk(subBreakdown, edge, referent, visitor);
+    for (let { edge: ed, referent, breakdown: subBreakdown }
+      of getReportEdges(breakdown, report)) {
+      recursiveWalk(subBreakdown, ed, referent, visitor);
     }
     visitor.exit(breakdown, report, edge);
   }
 }
 
 /**
  * Walk the given `report` that was generated by taking a census with the
  * specified `breakdown`.
@@ -231,18 +232,16 @@ DiffVisitor.prototype._set = function (r
     report[edge] = val;
   }
 };
 
 /**
  * @overrides Visitor.prototype.enter
  */
 DiffVisitor.prototype.enter = function (breakdown, report, edge) {
-  const isFirstTimeEntering = this._results === null;
-
   const newResults = breakdown.by === "allocationStack" ? new Map() : {};
   let newOther;
 
   if (!this._results) {
     // This is the first time we have entered a sub-report.
     this._results = newResults;
     newOther = this._otherCensus;
   } else {
@@ -269,18 +268,18 @@ DiffVisitor.prototype.exit = function (b
   // add them to the results directly.
   const other = this._otherCensusStack[this._otherCensusStack.length - 1];
   if (other) {
     const visited = this._edgesVisited[this._edgesVisited.length - 1];
     const unvisited = getReportEdges(breakdown, other)
       .map(e => e.edge)
       .filter(e => !visited.has(e));
     const results = this._resultsStack[this._resultsStack.length - 1];
-    for (let edge of unvisited) {
-      this._set(results, edge, this._get(other, edge));
+    for (let edg of unvisited) {
+      this._set(results, edg, this._get(other, edg));
     }
   }
 
   this._otherCensusStack.pop();
   this._resultsStack.pop();
   this._edgesVisited.pop();
 };
 
@@ -371,29 +370,27 @@ exports.diff = diff;
 /**
  * Creates a hash map mapping node IDs to its parent node.
  *
  * @param {CensusTreeNode} node
  * @param {Object<number, TreeNode>} aggregator
  *
  * @return {Object<number, TreeNode>}
  */
-const createParentMap = exports.createParentMap = function (node,
-                                                            getId = node => node.id,
-                                                            aggregator = Object.create(null)) {
+const createParentMap = function (node, getId = n => n.id, aggregator = {}) {
   if (node.children) {
     for (let i = 0, length = node.children.length; i < length; i++) {
       const child = node.children[i];
       aggregator[getId(child)] = node;
       createParentMap(child, getId, aggregator);
     }
   }
-
   return aggregator;
 };
+exports.createParentMap = createParentMap;
 
 const BUCKET = Object.freeze({ by: "bucket" });
 
 /**
  * Convert a breakdown whose leaves are { by: "count" } to an identical
  * breakdown, except with { by: "bucket" } leaves.
  *
  * @param {Object} breakdown
--- a/devtools/shared/heapsnapshot/DominatorTreeNode.js
+++ b/devtools/shared/heapsnapshot/DominatorTreeNode.js
@@ -232,17 +232,17 @@ DominatorTreeNode.partialTraversal = fun
  *
  * @param {DominatorTreeNode} tree
  * @param {Array<NodeId>} path
  * @param {Array<DominatorTreeNode>} newChildren
  * @param {Boolean} moreChildrenAvailable
  *
  * @returns {DominatorTreeNode}
  */
-DominatorTreeNode.insert = function (tree, path, newChildren, moreChildrenAvailable) {
+DominatorTreeNode.insert = function (nodeTree, path, newChildren, moreChildrenAvailable) {
   function insert(tree, i) {
     if (tree.nodeId !== path[i]) {
       return tree;
     }
 
     if (i == path.length - 1) {
       return immutableUpdate(tree, {
         children: (tree.children || []).concat(newChildren),
@@ -252,17 +252,17 @@ DominatorTreeNode.insert = function (tre
 
     return tree.children
       ? immutableUpdate(tree, {
         children: tree.children.map(c => insert(c, i + 1))
       })
       : tree;
   }
 
-  return insert(tree, 0);
+  return insert(nodeTree, 0);
 };
 
 /**
  * Get the new canonical node with the given `id` in `tree` that exists along
  * `path`. If there is no such node along `path`, return null.
  *
  * This is useful if we have a reference to a now-outdated DominatorTreeNode due
  * to a recent call to DominatorTreeNode.insert and want to get the up-to-date
--- a/devtools/shared/heapsnapshot/HeapAnalysesWorker.js
+++ b/devtools/shared/heapsnapshot/HeapAnalysesWorker.js
@@ -3,16 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 /* global ThreadSafeChromeUtils*/
 
 // This is a worker which reads offline heap snapshots into memory and performs
 // heavyweight analyses on them without blocking the main thread. A
 // HeapAnalysesWorker is owned and communicated with by a HeapAnalysesClient
 // instance. See HeapAnalysesClient.js.
 
+/* global importScripts, workerHelper, self */
+
 "use strict";
 
 importScripts("resource://gre/modules/workers/require.js");
 importScripts("resource://devtools/shared/worker/helper.js");
 const { censusReportToCensusTreeNode } = require("resource://devtools/shared/heapsnapshot/census-tree-node.js");
 const DominatorTreeNode = require("resource://devtools/shared/heapsnapshot/DominatorTreeNode.js");
 const CensusUtils = require("resource://devtools/shared/heapsnapshot/CensusUtils.js");
 
@@ -65,17 +67,18 @@ workerHelper.createTask(self, "deleteHea
     dominatorTreeSnapshots[dominatorTreeId] = undefined;
     dominatorTrees[dominatorTreeId] = undefined;
   }
 });
 
 /**
  * @see HeapAnalysesClient.prototype.takeCensus
  */
-workerHelper.createTask(self, "takeCensus", ({ snapshotFilePath, censusOptions, requestOptions }) => {
+workerHelper.createTask(self, "takeCensus", (
+{ snapshotFilePath, censusOptions, requestOptions }) => {
   if (!snapshots[snapshotFilePath]) {
     throw new Error(`No known heap snapshot for '${snapshotFilePath}'`);
   }
 
   let report = snapshots[snapshotFilePath].takeCensus(censusOptions);
   let parentMap;
 
   if (requestOptions.asTreeNode || requestOptions.asInvertedTreeNode) {
@@ -201,17 +204,17 @@ workerHelper.createTask(self, "getDomina
   const {
     dominatorTreeId,
     breakdown,
     maxDepth,
     maxSiblings,
     maxRetainingPaths,
   } = request;
 
-  if (!(0 <= dominatorTreeId && dominatorTreeId < dominatorTrees.length)) {
+  if (!(dominatorTreeId >= 0 && dominatorTreeId < dominatorTrees.length)) {
     throw new Error(
       `There does not exist a DominatorTree with the id ${dominatorTreeId}`);
   }
 
   const dominatorTree = dominatorTrees[dominatorTreeId];
   const snapshot = dominatorTreeSnapshots[dominatorTreeId];
 
   const tree = DominatorTreeNode.partialTraversal(dominatorTree,
@@ -247,17 +250,17 @@ workerHelper.createTask(self, "getImmedi
     dominatorTreeId,
     nodeId,
     breakdown,
     startIndex,
     maxCount,
     maxRetainingPaths,
   } = request;
 
-  if (!(0 <= dominatorTreeId && dominatorTreeId < dominatorTrees.length)) {
+  if (!(dominatorTreeId >= 0 && dominatorTreeId < dominatorTrees.length)) {
     throw new Error(
       `There does not exist a DominatorTree with the id ${dominatorTreeId}`);
   }
 
   const dominatorTree = dominatorTrees[dominatorTreeId];
   const snapshot = dominatorTreeSnapshots[dominatorTreeId];
 
   const childIds = dominatorTree.getImmediatelyDominated(nodeId);
--- a/devtools/shared/heapsnapshot/census-tree-node.js
+++ b/devtools/shared/heapsnapshot/census-tree-node.js
@@ -69,16 +69,17 @@ CensusTreeNodeCacheValue.prototype = nul
  * @param {SavedFrame} frame
  *        The SavedFrame object we would like to lookup in or insert into a
  *        CensusTreeNodeCache.
  *
  * @returns {String}
  *          The unique string that can be used as a key in a CensusTreeNodeCache.
  */
 CensusTreeNodeCache.hashFrame = function (frame) {
+  // eslint-disable-next-line max-len
   return `FRAME,${frame.functionDisplayName},${frame.source},${frame.line},${frame.column},${frame.asyncCause}`;
 };
 
 /**
  * Create a unique string for the given CensusTreeNode **with regards to
  * siblings at the current depth of the tree, not within the whole tree.** It
  * can be used as a hash to key this node within a CensusTreeNodeCache.
  *
--- a/devtools/shared/heapsnapshot/shortest-paths.js
+++ b/devtools/shared/heapsnapshot/shortest-paths.js
@@ -43,25 +43,27 @@ exports.deduplicatePaths = function (tar
     if (!nameSet) {
       nameSet = new Set();
       toMap.set(to, nameSet);
     }
 
     nameSet.add(name);
   }
 
+  // eslint-disable-next-line no-labels
   outer: for (let path of paths) {
     const pathLength = path.length;
 
     // Check for duplicate predecessors in the path, and skip paths that contain
     // them.
     const predecessorsSeen = new Set();
     predecessorsSeen.add(target);
     for (let i = 0; i < pathLength; i++) {
       if (predecessorsSeen.has(path[i].predecessor)) {
+        // eslint-disable-next-line no-labels
         continue outer;
       }
       predecessorsSeen.add(path[i].predecessor);
     }
 
     for (let i = 0; i < pathLength - 1; i++) {
       insert(path[i].predecessor, path[i + 1].predecessor, path[i].edge);
     }
new file mode 100644
--- /dev/null
+++ b/devtools/shared/heapsnapshot/tests/mochitest/.eslintrc.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = {
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../../.eslintrc.mochitests.js",
+  "globals": {
+    "ChromeUtils": true,
+    "sendAsyncMessage": true,
+  }
+};
--- a/devtools/shared/heapsnapshot/tests/mochitest/test_DominatorTree_01.html
+++ b/devtools/shared/heapsnapshot/tests/mochitest/test_DominatorTree_01.html
@@ -7,18 +7,21 @@ Sanity test that we can compute dominato
   <meta charset="utf-8">
   <title>ChromeUtils.saveHeapSnapshot test</title>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
 </head>
 <body>
 <pre id="test">
 <script>
+"use strict";
+/* global window, ChromeUtils, DominatorTree */
+
 SimpleTest.waitForExplicitFinish();
-window.onload = function() {
+window.onload = function () {
   const path = ChromeUtils.saveHeapSnapshot({ runtime: true });
   const snapshot = ChromeUtils.readHeapSnapshot(path);
 
   const dominatorTree = snapshot.computeDominatorTree();
   ok(dominatorTree);
   ok(dominatorTree instanceof DominatorTree);
 
   let threw = false;
--- a/devtools/shared/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html
+++ b/devtools/shared/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html
@@ -7,18 +7,20 @@ Bug 1024774 - Sanity test that we can ta
   <meta charset="utf-8">
   <title>ChromeUtils.saveHeapSnapshot test</title>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
 </head>
 <body>
 <pre id="test">
 <script>
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
-window.onload = function() {
+window.onload = function () {
   ok(ChromeUtils, "The ChromeUtils interface should be exposed in chrome windows.");
   ChromeUtils.saveHeapSnapshot({ runtime: true });
   ok(true, "Should save a heap snapshot and shouldn't throw.");
   SimpleTest.finish();
 };
 </script>
 </pre>
 </body>
--- a/devtools/shared/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html
+++ b/devtools/shared/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html
@@ -7,75 +7,75 @@ Bug 1201597 - Sanity test that we can ta
   <title>saveHeapSnapshot in e10s child processes</title>
   <script type="application/javascript"
           src="/tests/SimpleTest/SimpleTest.js">
   </script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
     <script type="application/javascript">
-     window.onerror = function (msg, url, line, col, err) {
-         ok(false, "@" + url + ":" + line + ":" + col + ": " + msg + "\n" + err.stack);
-     };
+    "use strict";
+    window.onerror = function (msg, url, line, col, err) {
+      ok(false, "@" + url + ":" + line + ":" + col + ": " + msg + "\n" + err.stack);
+    };
 
-     SimpleTest.waitForExplicitFinish();
+    SimpleTest.waitForExplicitFinish();
 
-     var childFrameURL = "data:text/html,<!DOCTYPE HTML><html><body></body></html>";
+    var childFrameURL = "data:text/html,<!DOCTYPE HTML><html><body></body></html>";
 
-     // This function is stringified and loaded in the child process as a frame
-     // script.
-     function childFrameScript() {
-         try {
-             ChromeUtils.saveHeapSnapshot({ runtime: true });
-         } catch (err) {
-             sendAsyncMessage("testSaveHeapSnapshot:error",
-                              { error: err.toString() });
-             return;
-         }
+    // This function is stringified and loaded in the child process as a frame
+    // script.
+    function childFrameScript() {
+      try {
+        ChromeUtils.saveHeapSnapshot({ runtime: true });
+      } catch (err) {
+        sendAsyncMessage("testSaveHeapSnapshot:error",
+                          { error: err.toString() });
+        return;
+      }
 
-         sendAsyncMessage("testSaveHeapSnapshot:done", {});
-     }
+      sendAsyncMessage("testSaveHeapSnapshot:done", {});
+    }
 
-     // Kick everything off on load.
-     window.onload = function () {
-         info("window.onload fired");
-         SpecialPowers.addPermission("browser", true, document);
-         SpecialPowers.pushPrefEnv({
-             "set": [
-                 ["dom.ipc.browser_frames.oop_by_default", true],
-                 ["dom.mozBrowserFramesEnabled", true],
-                 ["browser.pagethumbnails.capturing_disabled", true]
-             ]
-         }, function () {
-             var iframe = document.createElement("iframe");
-             SpecialPowers.wrap(iframe).mozbrowser = true;
-             iframe.id = "iframe";
-             iframe.src = childFrameURL;
+    // Kick everything off on load.
+    window.onload = function () {
+      info("window.onload fired");
+      SpecialPowers.addPermission("browser", true, document);
+      SpecialPowers.pushPrefEnv({
+         "set": [
+             ["dom.ipc.browser_frames.oop_by_default", true],
+             ["dom.mozBrowserFramesEnabled", true],
+             ["browser.pagethumbnails.capturing_disabled", true]
+         ]
+      }, function () {
+        let iframe = document.createElement("iframe");
+        SpecialPowers.wrap(iframe).mozbrowser = true;
+        iframe.id = "iframe";
+        iframe.src = childFrameURL;
 
+        iframe.addEventListener("mozbrowserloadend", function () {
+          info("iframe done loading");
 
-             iframe.addEventListener("mozbrowserloadend", function () {
-                 info("iframe done loading");
-
-                 var mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
+          let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
-                 function onError(e) {
-                     ok(false, e.data.error);
-                 }
-                 mm.addMessageListener("testSaveHeapSnapshot:error", onError);
+          function onError(e) {
+            ok(false, e.data.error);
+          }
+          mm.addMessageListener("testSaveHeapSnapshot:error", onError);
 
-                 mm.addMessageListener("testSaveHeapSnapshot:done", function onMsg() {
-                     mm.removeMessageListener("testSaveHeapSnapshot:done", onMsg);
-                     mm.removeMessageListener("testSaveHeapSnapshot:error", onError);
-                     ok(true, "Saved heap snapshot in child process");
-                     SimpleTest.finish();
-                 });
+          mm.addMessageListener("testSaveHeapSnapshot:done", function onMsg() {
+            mm.removeMessageListener("testSaveHeapSnapshot:done", onMsg);
+            mm.removeMessageListener("testSaveHeapSnapshot:error", onError);
+            ok(true, "Saved heap snapshot in child process");
+            SimpleTest.finish();
+          });
 
-                 info("Loading frame script to save heap snapshot");
-                 mm.loadFrameScript("data:,(" + encodeURI(childFrameScript.toString()) + ")();",
-                                    false);
-             }, {once: true});
+          info("Loading frame script to save heap snapshot");
+          mm.loadFrameScript("data:,(" + encodeURI(childFrameScript.toString()) + ")();",
+                            false);
+        }, {once: true});
 
-             info("Loading iframe");
-             document.body.appendChild(iframe);
-         });
-     };
-    </script>
+        info("Loading iframe");
+        document.body.appendChild(iframe);
+      });
+    };
+  </script>
 </window>
--- a/devtools/shared/heapsnapshot/tests/unit/Census.jsm
+++ b/devtools/shared/heapsnapshot/tests/unit/Census.jsm
@@ -1,12 +1,14 @@
 // Functions for checking results returned by
 // Debugger.Memory.prototype.takeCensus and
 // HeapSnapshot.prototype.takeCensus. Adapted from js/src/jit-test/lib/census.js.
 
+"use strict";
+
 this.EXPORTED_SYMBOLS = ["Census"];
 
 this.Census = (function () {
   const Census = {};
 
   function dumpn(msg) {
     dump("DBG-TEST: Census.jsm: " + msg + "\n");
   }
@@ -57,17 +59,21 @@ this.Census = (function () {
     done: () => undefined,
     check: () => undefined
   };
 
   // A walker that requires all leaves to be zeros.
   Census.assertAllZeros = {
     enter: () => Census.assertAllZeros,
     done: () => undefined,
-    check: elt => { if (elt !== 0) throw new Error("Census mismatch: expected zero, found " + elt); }
+    check: elt => {
+      if (elt !== 0) {
+        throw new Error("Census mismatch: expected zero, found " + elt);
+      }
+    }
   };
 
   function expectedObject() {
     throw new Error("Census mismatch: subject has leaf where basis has nested object");
   }
 
   function expectedLeaf() {
     throw new Error("Census mismatch: subject has nested object where basis has leaf");
@@ -84,52 +90,57 @@ this.Census = (function () {
   //   |prop| which is present in the basis with value |value|.
   //
   // - extra(prop): Called when the subject has a property named |prop|, but the
   //   basis has no such property. This should return a walker that can check
   //   the subject's value.
   function makeBasisChecker({compare, missing, extra}) {
     return function makeWalker(basis) {
       if (typeof basis === "object") {
-        var unvisited = new Set(Object.getOwnPropertyNames(basis));
+        let unvisited = new Set(Object.getOwnPropertyNames(basis));
         return {
           enter: prop => {
             unvisited.delete(prop);
             if (prop in basis) {
               return makeWalker(basis[prop]);
-            } else {
-              return extra(prop);
             }
+
+            return extra(prop);
           },
 
           done: () => unvisited.forEach(prop => missing(prop, basis[prop])),
           check: expectedObject
         };
-      } else {
-        return {
-          enter: expectedLeaf,
-          done: expectedLeaf,
-          check: elt => compare(elt, basis)
-        };
       }
+
+      return {
+        enter: expectedLeaf,
+        done: expectedLeaf,
+        check: elt => compare(elt, basis)
+      };
     };
   }
 
   function missingProp(prop) {
     throw new Error("Census mismatch: subject lacks property present in basis: " + prop);
   }
 
   function extraProp(prop) {
-    throw new Error("Census mismatch: subject has property not present in basis: " + prop);
+    throw new Error("Census mismatch: subject has property not present in basis: "
+      + prop);
   }
 
   // Return a walker that checks that the subject census has counts all equal to
   // |basis|.
   Census.assertAllEqual = makeBasisChecker({
-    compare: (a, b) => { if (a !== b) throw new Error("Census mismatch: expected " + a + " got " + b);},
+    compare: (a, b) => {
+      if (a !== b) {
+        throw new Error("Census mismatch: expected " + a + " got " + b);
+      }
+    },
     missing: missingProp,
     extra: extraProp
   });
 
   function ok(val) {
     if (!val) {
       throw new Error("Census mismatch: expected truthy, got " + val);
     }
@@ -150,16 +161,16 @@ this.Census = (function () {
     missing: missingProp,
     extra: () => Census.walkAnything
   });
 
   // Return a walker that checks that the subject census has within |fudge|
   // items of each category of the count in |basis|.
   Census.assertAllWithin = function (fudge, basis) {
     return makeBasisChecker({
-      compare: (subject, basis) => ok(Math.abs(subject - basis) <= fudge),
+      compare: (subject, base) => ok(Math.abs(subject - base) <= fudge),
       missing: missingProp,
       extra: () => Census.walkAnything
     })(basis);
   };
 
   return Census;
 }());
--- a/devtools/shared/heapsnapshot/tests/unit/Match.jsm
+++ b/devtools/shared/heapsnapshot/tests/unit/Match.jsm
@@ -1,190 +1,214 @@
 // A little pattern-matching library.
 //
 // Ported from js/src/tests/js1_8_5/reflect-parse/Match.js for use with devtools
 // server xpcshell tests.
 
+"use strict";
+
 this.EXPORTED_SYMBOLS = ["Match"];
 
-this.Match = (function() {
-
-    function Pattern(template) {
-        // act like a constructor even as a function
-        if (!(this instanceof Pattern))
-            return new Pattern(template);
-
-        this.template = template;
+this.Match = (function () {
+  function Pattern(template) {
+      // act like a constructor even as a function
+    if (!(this instanceof Pattern)) {
+      return new Pattern(template);
     }
 
-    Pattern.prototype = {
-        match: function(act) {
-            return match(act, this.template);
-        },
+    this.template = template;
+  }
+
+  Pattern.prototype = {
+    match: function (act) {
+      return match(act, this.template);
+    },
+
+    matches: function (act) {
+      try {
+        return this.match(act);
+      } catch (e) {
+        if (e instanceof MatchError) {
+          return false;
+        }
+      }
+      return false;
+    },
 
-        matches: function(act) {
-            try {
-                return this.match(act);
-            }
-            catch (e if e instanceof MatchError) {
-                return false;
-            }
-        },
+    assert: function (act, message) {
+      try {
+        return this.match(act);
+      } catch (e) {
+        if (e instanceof MatchError) {
+          throw new Error((message || "failed match") + ": " + e.message);
+        }
+      }
+      return false;
+    },
+
+    toString: () => "[object Pattern]"
+  };
+
+  Pattern.ANY = new Pattern();
+  Pattern.ANY.template = Pattern.ANY;
+
+  Pattern.NUMBER = new Pattern();
+  Pattern.NUMBER.match = function (act) {
+    if (typeof act !== "number") {
+      throw new MatchError("Expected number, got: " + quote(act));
+    }
+  };
 
-        assert: function(act, message) {
-            try {
-                return this.match(act);
-            }
-            catch (e if e instanceof MatchError) {
-                throw new Error((message || "failed match") + ": " + e.message);
-            }
-        },
+  Pattern.NATURAL = new Pattern();
+  Pattern.NATURAL.match = function (act) {
+    if (typeof act !== "number" || act !== Math.floor(act) || act < 0) {
+      throw new MatchError("Expected natural number, got: " + quote(act));
+    }
+  };
+
+  let quote = uneval;
+
+  function MatchError(msg) {
+    this.message = msg;
+  }
+
+  MatchError.prototype = {
+    toString: function () {
+      return "match error: " + this.message;
+    }
+  };
 
-        toString: () => "[object Pattern]"
-    };
+  function isAtom(x) {
+    return (typeof x === "number") ||
+        (typeof x === "string") ||
+        (typeof x === "boolean") ||
+        (x === null) ||
+        (typeof x === "object" && x instanceof RegExp);
+  }
 
-    Pattern.ANY = new Pattern;
-    Pattern.ANY.template = Pattern.ANY;
+  function isObject(x) {
+    return (x !== null) && (typeof x === "object");
+  }
 
-    Pattern.NUMBER = new Pattern;
-    Pattern.NUMBER.match = function (act) {
-      if (typeof act !== 'number') {
-        throw new MatchError("Expected number, got: " + quote(act));
+  function isFunction(x) {
+    return typeof x === "function";
+  }
+
+  function isArrayLike(x) {
+    return isObject(x) && ("length" in x);
+  }
+
+  function matchAtom(act, exp) {
+    if ((typeof exp) === "number" && isNaN(exp)) {
+      if ((typeof act) !== "number" || !isNaN(act)) {
+        throw new MatchError("expected NaN, got: " + quote(act));
       }
+      return true;
     }
 
-    Pattern.NATURAL = new Pattern
-    Pattern.NATURAL.match = function (act) {
-      if (typeof act !== 'number' || act !== Math.floor(act) || act < 0) {
-        throw new MatchError("Expected natural number, got: " + quote(act));
+    if (exp === null) {
+      if (act !== null) {
+        throw new MatchError("expected null, got: " + quote(act));
+      }
+      return true;
+    }
+
+    if (exp instanceof RegExp) {
+      if (!(act instanceof RegExp) || exp.source !== act.source) {
+        throw new MatchError("expected " + quote(exp) + ", got: " + quote(act));
+      }
+      return true;
+    }
+
+    switch (typeof exp) {
+      case "string":
+        if (act !== exp) {
+          throw new MatchError("expected " + quote(exp) + ", got " + quote(act));
+        }
+        return true;
+      case "boolean":
+      case "number":
+        if (exp !== act) {
+          throw new MatchError("expected " + exp + ", got " + quote(act));
+        }
+        return true;
+    }
+
+    throw new Error("bad pattern: " + exp.toSource());
+  }
+
+  function matchObject(act, exp) {
+    if (!isObject(act)) {
+      throw new MatchError("expected object, got " + quote(act));
+    }
+
+    for (let key in exp) {
+      if (!(key in act)) {
+        throw new MatchError("expected property " + quote(key)
+          + " not found in " + quote(act));
+      }
+      match(act[key], exp[key]);
+    }
+
+    return true;
+  }
+
+  function matchFunction(act, exp) {
+    if (!isFunction(act)) {
+      throw new MatchError("expected function, got " + quote(act));
+    }
+
+    if (act !== exp) {
+      throw new MatchError("expected function: " + exp +
+                             "\nbut got different function: " + act);
+    }
+  }
+
+  function matchArray(act, exp) {
+    if (!isObject(act) || !("length" in act)) {
+      throw new MatchError("expected array-like object, got " + quote(act));
+    }
+
+    let length = exp.length;
+    if (act.length !== exp.length) {
+      throw new MatchError("expected array-like object of length "
+        + length + ", got " + quote(act));
+    }
+
+    for (let i = 0; i < length; i++) {
+      if (i in exp) {
+        if (!(i in act)) {
+          throw new MatchError("expected array property " + i + " not found in "
+            + quote(act));
+        }
+        match(act[i], exp[i]);
       }
     }
 
-    var quote = uneval;
+    return true;
+  }
 
-    function MatchError(msg) {
-        this.message = msg;
+  function match(act, exp) {
+    if (exp === Pattern.ANY) {
+      return true;
     }
 
-    MatchError.prototype = {
-        toString: function() {
-            return "match error: " + this.message;
-        }
-    };
-
-    function isAtom(x) {
-        return (typeof x === "number") ||
-            (typeof x === "string") ||
-            (typeof x === "boolean") ||
-            (x === null) ||
-            (typeof x === "object" && x instanceof RegExp);
-    }
-
-    function isObject(x) {
-        return (x !== null) && (typeof x === "object");
-    }
-
-    function isFunction(x) {
-        return typeof x === "function";
-    }
-
-    function isArrayLike(x) {
-        return isObject(x) && ("length" in x);
+    if (exp instanceof Pattern) {
+      return exp.match(act);
     }
 
-    function matchAtom(act, exp) {
-        if ((typeof exp) === "number" && isNaN(exp)) {
-            if ((typeof act) !== "number" || !isNaN(act))
-                throw new MatchError("expected NaN, got: " + quote(act));
-            return true;
-        }
-
-        if (exp === null) {
-            if (act !== null)
-                throw new MatchError("expected null, got: " + quote(act));
-            return true;
-        }
-
-        if (exp instanceof RegExp) {
-            if (!(act instanceof RegExp) || exp.source !== act.source)
-                throw new MatchError("expected " + quote(exp) + ", got: " + quote(act));
-            return true;
-        }
-
-        switch (typeof exp) {
-        case "string":
-            if (act !== exp)
-                throw new MatchError("expected " + quote(exp) + ", got " + quote(act));
-            return true;
-        case "boolean":
-        case "number":
-            if (exp !== act)
-                throw new MatchError("expected " + exp + ", got " + quote(act));
-            return true;
-        }
-
-        throw new Error("bad pattern: " + exp.toSource());
+    if (isAtom(exp)) {
+      return matchAtom(act, exp);
     }
 
-    function matchObject(act, exp) {
-        if (!isObject(act))
-            throw new MatchError("expected object, got " + quote(act));
-
-        for (var key in exp) {
-            if (!(key in act))
-                throw new MatchError("expected property " + quote(key) + " not found in " + quote(act));
-            match(act[key], exp[key]);
-        }
-
-        return true;
+    if (isArrayLike(exp)) {
+      return matchArray(act, exp);
     }
 
-    function matchFunction(act, exp) {
-        if (!isFunction(act))
-            throw new MatchError("expected function, got " + quote(act));
-
-        if (act !== exp)
-            throw new MatchError("expected function: " + exp +
-                                 "\nbut got different function: " + act);
+    if (isFunction(exp)) {
+      return matchFunction(act, exp);
     }
 
-    function matchArray(act, exp) {
-        if (!isObject(act) || !("length" in act))
-            throw new MatchError("expected array-like object, got " + quote(act));
-
-        var length = exp.length;
-        if (act.length !== exp.length)
-            throw new MatchError("expected array-like object of length " + length + ", got " + quote(act));
-
-        for (var i = 0; i < length; i++) {
-            if (i in exp) {
-                if (!(i in act))
-                    throw new MatchError("expected array property " + i + " not found in " + quote(act));
-                match(act[i], exp[i]);
-            }
-        }
-
-        return true;
-    }
+    return matchObject(act, exp);
+  }
 
-    function match(act, exp) {
-        if (exp === Pattern.ANY)
-            return true;
-
-        if (exp instanceof Pattern)
-            return exp.match(act);
-
-        if (isAtom(exp))
-            return matchAtom(act, exp);
-
-        if (isArrayLike(exp))
-            return matchArray(act, exp);
-
-        if (isFunction(exp))
-            return matchFunction(act, exp);
-
-        return matchObject(act, exp);
-    }
-
-    return { Pattern: Pattern,
-             MatchError: MatchError };
-
+  return { Pattern, MatchError };
 })();
--- a/devtools/shared/heapsnapshot/tests/unit/dominator-tree-worker.js
+++ b/devtools/shared/heapsnapshot/tests/unit/dominator-tree-worker.js
@@ -1,32 +1,34 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 console.log("Initializing worker.");
 
 self.onmessage = e => {
   console.log("Starting test.");
   try {
     const path = ThreadSafeChromeUtils.saveHeapSnapshot({ runtime: true });
     const snapshot = ThreadSafeChromeUtils.readHeapSnapshot(path);
 
     const dominatorTree = snapshot.computeDominatorTree();
     ok(dominatorTree);
     ok(dominatorTree instanceof DominatorTree);
 
     let threw = false;
     try {
       new DominatorTree();
-    } catch (e) {
+    } catch (excp) {
       threw = true;
     }
     ok(threw, "Constructor shouldn't be usable");
-  } catch (e) {
-    ok(false, "Unexpected error inside worker:\n" + e.toString() + "\n" + e.stack);
+  } catch (ex) {
+    ok(false, "Unexpected error inside worker:\n" + ex.toString() + "\n" + ex.stack);
   } finally {
     done();
   }
 };
 
 // Proxy assertions to the main thread.
 function ok(val, msg) {
   console.log("ok(" + !!val + ", \"" + msg + "\")");
--- a/devtools/shared/heapsnapshot/tests/unit/head_heapsnapshot.js
+++ b/devtools/shared/heapsnapshot/tests/unit/head_heapsnapshot.js
@@ -1,38 +1,42 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
+/* exported Cr, CC, Match, Census, Task, DevToolsUtils, HeapAnalysesClient,
+  assertThrows, getFilePath, saveHeapSnapshotAndTakeCensus,
+  saveHeapSnapshotAndComputeDominatorTree, compareCensusViewData, assertDiff,
+  assertLabelAndShallowSize, makeTestDominatorTreeNode,
+  assertDominatorTreeNodeInsertion, assertDeduplicatedPaths,
+  assertCountToBucketBreakdown, pathEntry */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 var CC = Components.Constructor;
 
 const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 const { Match } = Cu.import("resource://test/Match.jsm", {});
 const { Census } = Cu.import("resource://test/Census.jsm", {});
 const { addDebuggerToGlobal } =
   Cu.import("resource://gre/modules/jsdebugger.jsm", {});
-const { Task } = require("devtools/shared/task");
 
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const flags = require("devtools/shared/flags");
 const HeapAnalysesClient =
   require("devtools/shared/heapsnapshot/HeapAnalysesClient");
 const Services = require("Services");
 const { censusReportToCensusTreeNode } = require("devtools/shared/heapsnapshot/census-tree-node");
 const CensusUtils = require("devtools/shared/heapsnapshot/CensusUtils");
 const DominatorTreeNode = require("devtools/shared/heapsnapshot/DominatorTreeNode");
 const { deduplicatePaths } = require("devtools/shared/heapsnapshot/shortest-paths");
 const { LabelAndShallowSizeVisitor } = DominatorTreeNode;
 
-
 // Always log packets when running tests. runxpcshelltests.py will throw
 // the output away anyway, unless you give it the --verbose flag.
 if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT) {
   Services.prefs.setBoolPref("devtools.debugger.log", true);
 }
 flags.wantLogging = true;
 
 const SYSTEM_PRINCIPAL = Cc["@mozilla.org/systemprincipal;1"]
@@ -70,49 +74,53 @@ addTestingFunctionsToGlobal(this);
  * tests to xpcshell tests.
  */
 function newGlobal() {
   const global = new Cu.Sandbox(SYSTEM_PRINCIPAL, { freshZone: true });
   addTestingFunctionsToGlobal(global);
   return global;
 }
 
-function assertThrowsValue(f, val, msg) {
-  var fullmsg;
+function assertThrows(f, val, msg) {
+  let fullmsg;
   try {
     f();
   } catch (exc) {
-    if ((exc === val) === (val === val) && (val !== 0 || 1 / exc === 1 / val))
+    if ((exc === val) && (val !== 0 || 1 / exc === 1 / val)) {
       return;
+    } else if (exc instanceof Error && exc.message === val) {
+      return;
+    }
     fullmsg = "Assertion failed: expected exception " + val + ", got " + exc;
   }
-  if (fullmsg === undefined)
+  if (fullmsg === undefined) {
     fullmsg = "Assertion failed: expected exception " + val + ", no exception thrown";
-  if (msg !== undefined)
+  }
+  if (msg !== undefined) {
     fullmsg += " - " + msg;
+  }
   throw new Error(fullmsg);
 }
 
 /**
  * Returns the full path of the file with the specified name in a
  * platform-independent and URL-like form.
  */
-function getFilePath(aName, aAllowMissing = false, aUsePlatformPathSeparator = false)
-{
-  let file = do_get_file(aName, aAllowMissing);
+function getFilePath(name, allowMissing = false, usePlatformPathSeparator = false) {
+  let file = do_get_file(name, allowMissing);
   let path = Services.io.newFileURI(file).spec;
   let filePrePath = "file://";
   if ("nsILocalFileWin" in Ci &&
       file instanceof Ci.nsILocalFileWin) {
     filePrePath += "/";
   }
 
   path = path.slice(filePrePath.length);
 
-  if (aUsePlatformPathSeparator && path.match(/^\w:/)) {
+  if (sePlatformPathSeparator && path.match(/^\w:/)) {
     path = path.replace(/\//g, "\\");
   }
 
   return path;
 }
 
 function saveNewHeapSnapshot(opts = { runtime: true }) {
   const filePath = ChromeUtils.saveHeapSnapshot(opts);
@@ -147,17 +155,18 @@ function readHeapSnapshot(filePath) {
  *
  * @returns Census
  */
 function saveHeapSnapshotAndTakeCensus(dbg = null, censusOptions = undefined) {
   const snapshotOptions = dbg ? { debugger: dbg } : { runtime: true };
   const filePath = saveNewHeapSnapshot(snapshotOptions);
   const snapshot = readHeapSnapshot(filePath);
 
-  equal(typeof snapshot.takeCensus, "function", "snapshot should have a takeCensus method");
+  equal(typeof snapshot.takeCensus, "function",
+    "snapshot should have a takeCensus method");
 
   return snapshot.takeCensus(censusOptions);
 }
 
 /**
  * Save a heap snapshot to disk, read it back as a HeapSnapshot instance, and
  * then compute its dominator tree.
  *
@@ -185,19 +194,18 @@ function saveHeapSnapshotAndComputeDomin
 
 function isSavedFrame(obj) {
   return Object.prototype.toString.call(obj) === "[object SavedFrame]";
 }
 
 function savedFrameReplacer(key, val) {
   if (isSavedFrame(val)) {
     return `<SavedFrame '${val.toString().split(/\n/g).shift()}'>`;
-  } else {
-    return val;
   }
+  return val;
 }
 
 /**
  * Assert that creating a CensusTreeNode from the given `report` with the
  * specified `breakdown` creates the given `expected` CensusTreeNode.
  *
  * @param {Object} breakdown
  *        The census breakdown.
@@ -239,49 +247,52 @@ function assertStructurallyEquivalent(ac
     equal(actualProtoString, expectedProtoString,
           `${path}: Object.prototype.toString.call() should be the same`);
 
     if (actualProtoString === "[object Map]") {
       const expectedKeys = new Set([...expected.keys()]);
 
       for (let key of actual.keys()) {
         ok(expectedKeys.has(key),
-           `${path}: every key in actual should exist in expected: ${String(key).slice(0, 10)}`);
+          `${path}: every key in actual is expected: ${String(key).slice(0, 10)}`);
         expectedKeys.delete(key);
 
         assertStructurallyEquivalent(actual.get(key), expected.get(key),
                                      path + ".get(" + String(key).slice(0, 20) + ")");
       }
 
       equal(expectedKeys.size, 0,
-            `${path}: every key in expected should also exist in actual, did not see ${[...expectedKeys]}`);
+        `${path}: every key in expected should also exist in actual,\
+        did not see ${[...expectedKeys]}`);
     } else if (actualProtoString === "[object Set]") {
       const expectedItems = new Set([...expected]);
 
       for (let item of actual) {
         ok(expectedItems.has(item),
            `${path}: every set item in actual should exist in expected: ${item}`);
         expectedItems.delete(item);
       }
 
       equal(expectedItems.size, 0,
-            `${path}: every set item in expected should also exist in actual, did not see ${[...expectedItems]}`);
+        `${path}: every set item in expected should also exist in actual,\
+        did not see ${[...expectedItems]}`);
     } else {
       const expectedKeys = new Set(Object.keys(expected));
 
       for (let key of Object.keys(actual)) {
         ok(expectedKeys.has(key),
            `${path}: every key in actual should exist in expected: ${key}`);
         expectedKeys.delete(key);
 
         assertStructurallyEquivalent(actual[key], expected[key], path + "." + key);
       }
 
       equal(expectedKeys.size, 0,
-            `${path}: every key in expected should also exist in actual, did not see ${[...expectedKeys]}`);
+        `${path}: every key in expected should also exist in actual,\
+        did not see ${[...expectedKeys]}`);
     }
   } else {
     equal(actual, expected, `${path}: primitives should be equal`);
   }
 }
 
 /**
  * Assert that creating a diff of the `first` and `second` census reports
@@ -316,17 +327,18 @@ function assertDiff(breakdown, first, se
  * Assert that creating a label and getting a shallow size from the given node
  * description with the specified breakdown is as expected.
  *
  * @param {Object} breakdown
  * @param {Object} givenDescription
  * @param {Number} expectedShallowSize
  * @param {Object} expectedLabel
  */
-function assertLabelAndShallowSize(breakdown, givenDescription, expectedShallowSize, expectedLabel) {
+function assertLabelAndShallowSize(breakdown, givenDescription,
+  expectedShallowSize, expectedLabel) {
   dumpn("Computing label and shallow size from node description:");
   dumpn("Breakdown: " + JSON.stringify(breakdown, null, 4));
   dumpn("Given description: " + JSON.stringify(givenDescription, null, 4));
 
   const visitor = new LabelAndShallowSizeVisitor();
   CensusUtils.walk(breakdown, description, visitor);
 
   dumpn("Expected shallow size: " + expectedShallowSize);
@@ -359,28 +371,29 @@ function makeTestDominatorTreeNode(opts,
     shallowSize: 1,
     retainedSize: (children || []).reduce((size, c) => size + c.retainedSize, 1),
     parentId: undefined,
     children,
     moreChildrenAvailable: true,
   }, opts);
 
   if (children && children.length) {
-    children.map(c => c.parentId = node.nodeId);
+    children.map(c => (c.parentId = node.nodeId));
   }
 
   return node;
 }
 
 /**
  * Insert `newChildren` into the given dominator `tree` as specified by the
  * `path` from the root to the node the `newChildren` should be inserted
  * beneath. Assert that the resulting tree matches `expected`.
  */
-function assertDominatorTreeNodeInsertion(tree, path, newChildren, moreChildrenAvailable, expected) {
+function assertDominatorTreeNodeInsertion(tree, path, newChildren,
+  moreChildrenAvailable, expected) {
   dumpn("Inserting new children into a dominator tree:");
   dumpn("Dominator tree: " + JSON.stringify(tree, null, 2));
   dumpn("Path: " + JSON.stringify(path, null, 2));
   dumpn("New children: " + JSON.stringify(newChildren, null, 2));
   dumpn("Expected resulting tree: " + JSON.stringify(expected, null, 2));
 
   const actual = DominatorTreeNode.insert(tree, path, newChildren, moreChildrenAvailable);
   dumpn("Actual resulting tree: " + JSON.stringify(actual, null, 2));
@@ -420,17 +433,18 @@ function assertDeduplicatedPaths({ targe
     for (let edge of edges) {
       if (edge.from === expectedEdge.from &&
           edge.to === expectedEdge.to &&
           edge.name === expectedEdge.name) {
         count++;
       }
     }
     equal(count, 1,
-          "should have exactly one matching edge for the expected edge = " + JSON.stringify(edge));
+      "should have exactly one matching edge for the expected edge = "
+      + JSON.stringify(edge));
   }
 }
 
 function assertCountToBucketBreakdown(breakdown, expected) {
   dumpn("count => bucket breakdown");
   dumpn("Initial breakdown = ", JSON.stringify(breakdown, null, 2));
   dumpn("Expected results = ", JSON.stringify(expected, null, 2));
 
--- a/devtools/shared/heapsnapshot/tests/unit/heap-snapshot-worker.js
+++ b/devtools/shared/heapsnapshot/tests/unit/heap-snapshot-worker.js
@@ -1,14 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 console.log("Initializing worker.");
 
-self.onmessage = e => {
+self.onmessage = ex => {
   console.log("Starting test.");
   try {
     ok(typeof ChromeUtils === "undefined",
        "Should not have access to ChromeUtils in a worker.");
     ok(ThreadSafeChromeUtils,
        "Should have access to ThreadSafeChromeUtils in a worker.");
     ok(HeapSnapshot,
        "Should have access to HeapSnapshot in a worker.");
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can generate label structures from node description reports.
 
 const breakdown = {
   by: "coarseType",
   objects: {
     by: "objectClass",
     then: { by: "count", count: true, bytes: true },
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can generate label structures from node description reports.
 
 const breakdown = {
   by: "coarseType",
   objects: {
     by: "objectClass",
     then: { by: "count", count: true, bytes: true },
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can generate label structures from node description reports.
 
 const breakdown = {
   by: "coarseType",
   objects: {
     by: "objectClass",
     then: { by: "count", count: true, bytes: true },
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can generate label structures from node description reports.
 
 const breakdown = {
   by: "coarseType",
   objects: {
     by: "objectClass",
     then: {
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js
@@ -64,17 +64,18 @@ const expected = [
       edges: [
         { from: 2100, to: 2200, name: "e" },
         { from: 2200, to: 2300, name: "f" },
         { from: 2300, to: 2000, name: "g" },
       ]
     }
   }),
 
-  makeTestDominatorTreeNode({ nodeId: 3000,
+  makeTestDominatorTreeNode({
+    nodeId: 3000,
     shortestPaths: {
       nodes: [
         { id: 3000, label: ["SomeType-3000"] },
         { id: 3100, label: ["SomeType-3100"] },
         { id: 3200, label: ["SomeType-3200"] },
         { id: 3300, label: ["SomeType-3300"] },
         { id: 3400, label: ["SomeType-3400"] },
       ],
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can find the node with the given id along the specified path.
 
 const node3000 = makeTestDominatorTreeNode({ nodeId: 3000 });
 
 const node2000 = makeTestDominatorTreeNode({ nodeId: 2000 }, [
   makeTestDominatorTreeNode({}),
   node3000,
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can insert new children into an existing DominatorTreeNode tree.
 
 const tree = makeTestDominatorTreeNode({ nodeId: 1000 }, [
   makeTestDominatorTreeNode({}),
   makeTestDominatorTreeNode({ nodeId: 2000 }, [
     makeTestDominatorTreeNode({}),
     makeTestDominatorTreeNode({ nodeId: 3000 }),
@@ -103,10 +104,11 @@ const expected = {
       moreChildrenAvailable: true,
       children: undefined,
     }
   ],
   moreChildrenAvailable: true
 };
 
 function run_test() {
-  assertDominatorTreeNodeInsertion(tree, path, newChildren, moreChildrenAvailable, expected);
+  assertDominatorTreeNodeInsertion(tree, path, newChildren,
+    moreChildrenAvailable, expected);
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test attempting to insert new children into an existing DominatorTreeNode
 // tree with a bad path.
 
 const tree = makeTestDominatorTreeNode({}, [
   makeTestDominatorTreeNode({}),
   makeTestDominatorTreeNode({}, [
     makeTestDominatorTreeNode({}),
@@ -21,10 +22,11 @@ const newChildren = [
   makeTestDominatorTreeNode({ parentId: 333333 }),
 ];
 
 const moreChildrenAvailable = false;
 
 const expected = tree;
 
 function run_test() {
-  assertDominatorTreeNodeInsertion(tree, path, newChildren, moreChildrenAvailable, expected);
+  assertDominatorTreeNodeInsertion(tree, path, newChildren,
+    moreChildrenAvailable, expected);
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test inserting new children into an existing DominatorTreeNode at the root.
 
 const tree = makeTestDominatorTreeNode({ nodeId: 666 }, [
   makeTestDominatorTreeNode({}),
   makeTestDominatorTreeNode({}, [
     makeTestDominatorTreeNode({}),
     makeTestDominatorTreeNode({}),
@@ -108,10 +109,11 @@ const expected = {
       moreChildrenAvailable: true,
       children: undefined
     }
   ],
   moreChildrenAvailable: false
 };
 
 function run_test() {
-  assertDominatorTreeNodeInsertion(tree, path, newChildren, moreChildrenAvailable, expected);
+  assertDominatorTreeNodeInsertion(tree, path, newChildren,
+    moreChildrenAvailable, expected);
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we correctly set `moreChildrenAvailable` when doing a partial
 // traversal of a dominator tree to create the initial incrementally loaded
 // `DominatorTreeNode` tree.
 
 // `tree` maps parent to children:
 //
 // 100
@@ -149,16 +150,18 @@ const expected = {
 
 function run_test() {
   // Traverse the whole depth of the test tree, but one short of the number of
   // siblings. This will exercise the moreChildrenAvailable handling for
   // siblings.
   const actual = DominatorTreeNode.partialTraversal(mockDominatorTree,
                                                     mockSnapshot,
                                                     breakdown,
-                                                    /* maxDepth = */ 4,
-                                                    /* siblings = */ 2);
+                                                    // maxDepth
+                                                    4,
+                                                    // siblings
+                                                    2);
 
   dumpn("Expected = " + JSON.stringify(expected, null, 2));
   dumpn("Actual = " + JSON.stringify(actual, null, 2));
 
   assertStructurallyEquivalent(expected, actual);
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Sanity test that we can compute dominator trees.
 
 function run_test() {
   const path = ChromeUtils.saveHeapSnapshot({ runtime: true });
   const snapshot = ChromeUtils.readHeapSnapshot(path);
 
   const dominatorTree = snapshot.computeDominatorTree();
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can compute dominator trees from a snapshot in a worker.
 
 add_task(function* () {
   const worker = new ChromeWorker("resource://test/dominator-tree-worker.js");
   worker.postMessage({});
 
   let assertionCount = 0;
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can get the root of dominator trees.
 
 function run_test() {
   const dominatorTree = saveHeapSnapshotAndComputeDominatorTree();
   equal(typeof dominatorTree.root, "number", "root should be a number");
   equal(Math.floor(dominatorTree.root), dominatorTree.root, "root should be an integer");
   ok(dominatorTree.root >= 0, "root should be positive");
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_04.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can get the retained sizes of dominator trees.
 
 function run_test() {
   const dominatorTree = saveHeapSnapshotAndComputeDominatorTree();
   equal(typeof dominatorTree.getRetainedSize, "function",
         "getRetainedSize should be a function");
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_05.js
@@ -1,65 +1,67 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can get the set of immediately dominated nodes for any given
 // node and that this forms a tree.
 
 function run_test() {
-  var dominatorTree = saveHeapSnapshotAndComputeDominatorTree();
+  let dominatorTree = saveHeapSnapshotAndComputeDominatorTree();
   equal(typeof dominatorTree.getImmediatelyDominated, "function",
         "getImmediatelyDominated should be a function");
 
   // Do a traversal of the dominator tree.
   //
   // Note that we don't assert directly, only if we get an unexpected
   // value. There are just way too many nodes in the heap graph to assert for
   // every one. This test would constantly time out and assertion messages would
   // overflow the log size.
 
-  var root = dominatorTree.root;
+  let root = dominatorTree.root;
   equal(dominatorTree.getImmediateDominator(root), null,
         "The root should not have a parent");
 
-  var seen = new Set();
-  var stack = [root];
+  let seen = new Set();
+  let stack = [root];
   while (stack.length > 0) {
-    var top = stack.pop();
+    let top = stack.pop();
 
     if (seen.has(top)) {
-      ok(false,
-         "This is a tree, not a graph: we shouldn't have multiple edges to the same node");
+      ok(false, "This is a tree, not a graph: we shouldn't have "
+        + "multiple edges to the same node");
     }
     seen.add(top);
     if (seen.size % 1000 === 0) {
       dumpn("Progress update: seen size = " + seen.size);
     }
 
-    var newNodes = dominatorTree.getImmediatelyDominated(top);
+    let newNodes = dominatorTree.getImmediatelyDominated(top);
     if (Object.prototype.toString.call(newNodes) !== "[object Array]") {
       ok(false, "getImmediatelyDominated should return an array for known node ids");
     }
 
-    var topSize = dominatorTree.getRetainedSize(top);
+    let topSize = dominatorTree.getRetainedSize(top);
 
-    var lastSize = Infinity;
-    for (var i = 0; i < newNodes.length; i++) {
+    let lastSize = Infinity;
+    for (let i = 0; i < newNodes.length; i++) {
       if (typeof newNodes[i] !== "number") {
         ok(false, "Every dominated id should be a number");
       }
 
       if (dominatorTree.getImmediateDominator(newNodes[i]) !== top) {
         ok(false, "child's parent should be the expected parent");
       }
 
-      var thisSize = dominatorTree.getRetainedSize(newNodes[i]);
+      let thisSize = dominatorTree.getRetainedSize(newNodes[i]);
 
       if (thisSize >= topSize) {
-        ok(false, "the size of children in the dominator tree should always be less than that of their parent");
+        ok(false, "the size of children in the dominator tree should"
+          + " always be less than that of their parent");
       }
 
       if (thisSize > lastSize) {
         ok(false,
            "children should be sorted by greatest to least retained size, "
            + "lastSize = " + lastSize + ", thisSize = " + thisSize);
       }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_06.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_06.js
@@ -1,49 +1,50 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the retained size of a node is the sum of its children retained
 // sizes plus its shallow size.
 
 // Note that we don't assert directly, only if we get an unexpected
 // value. There are just way too many nodes in the heap graph to assert for
 // every one. This test would constantly time out and assertion messages would
 // overflow the log size.
 function fastAssert(cond, msg) {
   if (!cond) {
     ok(false, msg);
   }
 }
 
-var COUNT = { by: "count", count: false, bytes: true };
+let COUNT = { by: "count", count: false, bytes: true };
 
 function run_test() {
-  var path = saveNewHeapSnapshot();
-  var snapshot = ChromeUtils.readHeapSnapshot(path);
-  var dominatorTree = snapshot.computeDominatorTree();
+  let path = saveNewHeapSnapshot();
+  let snapshot = ChromeUtils.readHeapSnapshot(path);
+  let dominatorTree = snapshot.computeDominatorTree();
 
   // Do a traversal of the dominator tree and assert the relationship between
   // retained size, shallow size, and children's retained sizes.
 
-  var root = dominatorTree.root;
-  var stack = [root];
+  let root = dominatorTree.root;
+  let stack = [root];
   while (stack.length > 0) {
-    var top = stack.pop();
+    let top = stack.pop();
 
-    var children = dominatorTree.getImmediatelyDominated(top);
+    let children = dominatorTree.getImmediatelyDominated(top);
 
-    var topRetainedSize = dominatorTree.getRetainedSize(top);
-    var topShallowSize = snapshot.describeNode(COUNT, top).bytes;
+    let topRetainedSize = dominatorTree.getRetainedSize(top);
+    let topShallowSize = snapshot.describeNode(COUNT, top).bytes;
     fastAssert(topShallowSize <= topRetainedSize,
                "The shallow size should be less than or equal to the " +
                "retained size");
 
-    var sumOfChildrensRetainedSizes = 0;
-    for (var i = 0; i < children.length; i++) {
+    let sumOfChildrensRetainedSizes = 0;
+    for (let i = 0; i < children.length; i++) {
       sumOfChildrensRetainedSizes += dominatorTree.getRetainedSize(children[i]);
       stack.push(children[i]);
     }
 
     fastAssert(sumOfChildrensRetainedSizes <= topRetainedSize,
                "The sum of the children's retained sizes should be less than " +
                "or equal to the retained size");
     fastAssert(sumOfChildrensRetainedSizes + topShallowSize === topRetainedSize,
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test the HeapAnalyses{Client,Worker} "computeDominatorTree" request.
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test the HeapAnalyses{Client,Worker} "computeDominatorTree" request with bad
 // file paths.
 
 function run_test() {
   run_next_test();
 }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can delete heap snapshots.
 
 function run_test() {
   run_next_test();
 }
 
 const breakdown = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test deleteHeapSnapshot is a noop if the provided path matches no snapshot
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test other dominatorTrees can still be retrieved after deleting a snapshot
 
 function run_test() {
   run_next_test();
 }
 
 const breakdown = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can get census individuals.
 
 function run_test() {
   run_next_test();
 }
 
 const COUNT = { by: "count", count: true, bytes: true };
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
@@ -1,17 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can get a HeapSnapshot's
 // creation time.
 
 function waitForThirtyMilliseconds() {
   const start = Date.now();
-  while (Date.now() - start < 30) ;
+  while (Date.now() - start < 30) {
+    // do nothing
+  }
 }
 
 function run_test() {
   run_next_test();
 }
 
 const BREAKDOWN = {
   by: "internalType",
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test the HeapAnalyses{Client,Worker} "getDominatorTree" request.
 
 function run_test() {
   run_next_test();
 }
 
 const breakdown = {
@@ -42,17 +43,18 @@ add_task(function* () {
     } else {
       equal(typeof node.parentId, "number", "each node should have a parent id");
     }
 
     equal(typeof node.retainedSize, "number",
           "each node should have a retained size");
 
     ok(node.children === undefined || Array.isArray(node.children),
-       "each node either has a list of children, or undefined meaning no children loaded");
+       "each node either has a list of children, "
+       + "or undefined meaning no children loaded");
     equal(typeof node.moreChildrenAvailable, "boolean",
           "each node should indicate if there are more children available or not");
 
     equal(typeof node.shortestPaths, "object",
           "Should have shortest paths");
     equal(typeof node.shortestPaths.nodes, "object",
           "Should have shortest paths' nodes");
     equal(typeof node.shortestPaths.edges, "object",
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test the HeapAnalyses{Client,Worker} "getDominatorTree" request with bad
 // dominator tree ids.
 
 function run_test() {
   run_next_test();
 }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test the HeapAnalyses{Client,Worker} "getImmediatelyDominated" request.
 
 function run_test() {
   run_next_test();
 }
 
 const breakdown = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can read heap snapshots.
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take diffs between censuses.
 
 function run_test() {
   run_next_test();
 }
 
 const BREAKDOWN = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take diffs between censuses as
 // inverted trees.
 
 function run_test() {
   run_next_test();
 }
 
@@ -38,20 +39,21 @@ add_task(function* () {
   yield client.readHeapSnapshot(secondSnapshotFilePath);
 
   ok(true, "Should have read both heap snapshot files");
 
   const { delta } = yield client.takeCensusDiff(firstSnapshotFilePath,
                                                 secondSnapshotFilePath,
                                                 { breakdown: BREAKDOWN });
 
-  const { delta: deltaTreeNode } = yield client.takeCensusDiff(firstSnapshotFilePath,
-                                                               secondSnapshotFilePath,
-                                                               { breakdown: BREAKDOWN },
-                                                               { asInvertedTreeNode: true });
+  const { delta: deltaTreeNode }
+    = yield client.takeCensusDiff(firstSnapshotFilePath,
+                                 secondSnapshotFilePath,
+                                 { breakdown: BREAKDOWN },
+                                 { asInvertedTreeNode: true });
 
   // Have to manually set these because symbol properties aren't structured
   // cloned.
   delta[CensusUtils.basisTotalBytes] = deltaTreeNode.totalBytes;
   delta[CensusUtils.basisTotalCount] = deltaTreeNode.totalCount;
 
   compareCensusViewData(BREAKDOWN, delta, deltaTreeNode, { invert: true });
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take censuses.
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take censuses with breakdown
 // options.
 
 function run_test() {
   run_next_test();
 }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} bubbles errors properly when things
 // go wrong.
 
 function run_test() {
   run_next_test();
 }
 
@@ -22,17 +23,18 @@ add_task(function* () {
 
   // Snapshot file path to a file that is not a heap snapshot.
   failed = false;
   try {
     yield client.readHeapSnapshot(getFilePath("test_HeapAnalyses_takeCensus_03.js"));
   } catch (e) {
     failed = true;
   }
-  ok(failed, "should not be able to read a file that is not a heap snapshot as a heap snapshot");
+  ok(failed, "should not be able to read a file "
+    + "that is not a heap snapshot as a heap snapshot");
 
   const snapshotFilePath = saveNewHeapSnapshot();
   yield client.readHeapSnapshot(snapshotFilePath);
   ok(true, "Should have read the heap snapshot");
 
   // Bad census breakdown options.
   failed = false;
   try {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can send SavedFrame stacks from
 // by-allocation-stack reports from the worker.
 
 function run_test() {
   run_next_test();
 }
 
@@ -15,17 +16,17 @@ add_task(function* test() {
 
   const g = newGlobal();
   const dbg = new Debugger(g);
   g.eval(`                                                   // 1
          this.log = [];                                      // 2
          function f() { this.log.push(allocationMarker()); } // 3
          function g() { this.log.push(allocationMarker()); } // 4
          function h() { this.log.push(allocationMarker()); } // 5
-         `);                                                 // 6
+         `);
 
   // Create one allocationMarker with tracking turned off,
   // so it will have no associated stack.
   g.f();
 
   dbg.memory.allocationSamplingProbability = 1;
 
   for (let [func, n] of [ [g.f, 20],
@@ -44,40 +45,46 @@ add_task(function* test() {
 
   const snapshotFilePath = saveNewHeapSnapshot({ debugger: dbg });
   yield client.readHeapSnapshot(snapshotFilePath);
   ok(true, "Should have read the heap snapshot");
 
   // Run a census broken down by class name -> allocation stack so we can grab
   // only the AllocationMarker objects we have complete control over.
 
-  const { report } = yield client.takeCensus(snapshotFilePath, {
-    breakdown: { by: "objectClass",
-                 then: { by: "allocationStack",
-                         then: { by: "count",
-                                 bytes: true,
-                                 count: true
-                               },
-                         noStack: { by: "count",
-                                    bytes: true,
-                                    count: true
-                                  }
-                       }
-               }
-  });
+  const { report } = yield client.takeCensus(
+    snapshotFilePath,
+    {
+      breakdown: {
+        by: "objectClass",
+        then: {
+          by: "allocationStack",
+          then: {
+            by: "count",
+            bytes: true,
+            count: true
+          },
+          noStack: {
+            by: "count",
+            bytes: true,
+            count: true
+          }
+        }
+      }
+    });
 
   // Test the generated report.
 
   ok(report, "Should get a report");
 
   const map = report.AllocationMarker;
   ok(map, "Should get AllocationMarkers in the report.");
   // From a module with a different global, and therefore a different Map
   // constructor, so we can't use instanceof.
-  equal(map.__proto__.constructor.name, "Map");
+  equal(Object.getPrototypeOf(map).constructor.name, "Map");
 
   equal(map.size, 4, "Should have 4 allocation stacks (including the lack of a stack)");
 
   // Gather the stacks we are expecting to appear as keys, and
   // check that there are no unexpected keys.
   let stacks = {};
 
   map.forEach((v, k) => {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take censuses and return
 // a CensusTreeNode.
 
 function run_test() {
   run_next_test();
 }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take censuses by
 // "allocationStack" and return a CensusTreeNode.
 
 function run_test() {
   run_next_test();
 }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can take censuses and return
 // an inverted CensusTreeNode.
 
 function run_test() {
   run_next_test();
 }
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Sanity test that we can compute shortest paths.
 //
 // Because the actual heap graph is too unpredictable and likely to drastically
 // change as various implementation bits change, we don't test exact paths
 // here. See js/src/jsapi-tests/testUbiNode.cpp for such tests, where we can
 // control the specific graph shape and structure and so testing exact paths is
 // reliable.
@@ -16,48 +17,49 @@ function run_test() {
   const dominatorTree = snapshot.computeDominatorTree();
   const dominatedByRoot = dominatorTree.getImmediatelyDominated(dominatorTree.root)
                                        .slice(0, 10);
   ok(dominatedByRoot);
   ok(dominatedByRoot.length);
 
   const targetSet = new Set(dominatedByRoot);
 
-  const shortestPaths = snapshot.computeShortestPaths(dominatorTree.root, dominatedByRoot, 2);
+  const shortestPaths
+    = snapshot.computeShortestPaths(dominatorTree.root, dominatedByRoot, 2);
   ok(shortestPaths);
   ok(shortestPaths instanceof Map);
   ok(shortestPaths.size === targetSet.size);
 
   for (let [target, paths] of shortestPaths) {
     ok(targetSet.has(target),
        "We should only get paths for our targets");
     targetSet.delete(target);
 
     ok(paths.length > 0,
        "We must have at least one path, since the target is dominated by the root");
     ok(paths.length <= 2,
        "Should not have recorded more paths than the max requested");
 
     dumpn("---------------------");
     dumpn("Shortest paths for 0x" + target.toString(16) + ":");
-    for (let path of paths) {
+    for (let pth of paths) {
       dumpn("    path =");
-      for (let part of path) {
+      for (let part of pth) {
         dumpn("        predecessor: 0x" + part.predecessor.toString(16) +
               "; edge: " + part.edge);
       }
     }
     dumpn("---------------------");
 
-    for (let path of paths) {
-      ok(path.length > 0, "Cannot have zero length paths");
-      ok(path[0].predecessor === dominatorTree.root,
+    for (let path2 of paths) {
+      ok(path2.length > 0, "Cannot have zero length paths");
+      ok(path2[0].predecessor === dominatorTree.root,
          "The first predecessor is always our start node");
 
-      for (let part of path) {
+      for (let part of path2) {
         ok(part.predecessor, "Each part of a path has a predecessor");
         ok(!!snapshot.describeNode({ by: "count", count: true, bytes: true},
                                    part.predecessor),
            "The predecessor is in the heap snapshot");
         ok("edge" in part, "Each part has an (potentially null) edge property");
       }
     }
   }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test computing shortest paths with invalid arguments.
 
 function run_test() {
   const path = ChromeUtils.saveHeapSnapshot({ runtime: true });
   const snapshot = ChromeUtils.readHeapSnapshot(path);
 
   const dominatorTree = snapshot.computeDominatorTree();
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js
@@ -1,16 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.creationTime returns the expected time.
 
 function waitForThirtyMilliseconds() {
   const start = Date.now();
-  while (Date.now() - start < 30) ;
+  while (Date.now() - start < 30) {
+    // do nothing
+  }
 }
 
 function run_test() {
   const start = Date.now() * 1000;
   do_print("start                 = " + start);
 
   // Because Date.now() is less precise than the snapshot's time stamp, give it
   // a little bit of head room. Additionally, WinXP's timer only has granularity
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can save a core dump with very deep allocation stacks and read
 // it back into a HeapSnapshot.
 
 function stackDepth(stack) {
   return stack ? 1 + stackDepth(stack.parent) : 0;
 }
 
@@ -15,18 +16,19 @@ function run_test() {
   dbg.memory.trackingAllocationSites = true;
 
   // Allocate some objects in the debuggee that will have their allocation
   // stacks recorded by the Debugger.
 
   debuggee.eval("this.objects = []");
   debuggee.eval(
     (function recursiveAllocate(n) {
-      if (n <= 0)
+      if (n <= 0) {
         return;
+      }
 
       // Make sure to recurse before pushing the object so that when TCO is
       // implemented sometime in the future, it doesn't invalidate this test.
       recursiveAllocate(n - 1);
       this.objects.push({});
     }).toString()
   );
   debuggee.eval("recursiveAllocate = recursiveAllocate.bind(this);");
@@ -41,17 +43,17 @@ function run_test() {
   const snapshot = ChromeUtils.readHeapSnapshot(filePath);
   ok(snapshot, "Should be able to read a heap snapshot");
   ok(snapshot instanceof HeapSnapshot, "Should be an instanceof HeapSnapshot");
 
   const report = snapshot.takeCensus({
     breakdown: { by: "allocationStack",
                  then: { by: "count", bytes: true, count: true },
                  noStack: { by: "count", bytes: true, count: true }
-               }
+    }
   });
 
   // Keep this synchronized with `HeapSnapshot::MAX_STACK_DEPTH`!
   const MAX_STACK_DEPTH = 60;
 
   let foundStacks = false;
   report.forEach((v, k) => {
     if (k === "noStack") {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can describe nodes with a breakdown.
 
 function run_test() {
   const path = saveNewHeapSnapshot();
   const snapshot = ChromeUtils.readHeapSnapshot(path);
   ok(snapshot.describeNode);
   equal(typeof snapshot.describeNode, "function");
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js
@@ -1,31 +1,33 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.takeCensus returns a value of an appropriate
 // shape. Ported from js/src/jit-tests/debug/Memory-takeCensus-01.js
 
 function run_test() {
-  var dbg = new Debugger;
+  let dbg = new Debugger();
 
   function checkProperties(census) {
     equal(typeof census, "object");
-    for (prop of Object.getOwnPropertyNames(census)) {
-      var desc = Object.getOwnPropertyDescriptor(census, prop);
+    for (let prop of Object.getOwnPropertyNames(census)) {
+      let desc = Object.getOwnPropertyDescriptor(census, prop);
       equal(desc.enumerable, true);
       equal(desc.configurable, true);
       equal(desc.writable, true);
-      if (typeof desc.value === "object")
+      if (typeof desc.value === "object") {
         checkProperties(desc.value);
-      else
+      } else {
         equal(typeof desc.value, "number");
+      }
     }
   }
 
   checkProperties(saveHeapSnapshotAndTakeCensus(dbg));
 
-  var g = newGlobal();
+  let g = newGlobal();
   dbg.addDebuggee(g);
   checkProperties(saveHeapSnapshotAndTakeCensus(dbg));
 
   do_test_finished();
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js
@@ -1,57 +1,58 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.takeCensus behaves plausibly as we allocate objects.
 //
 // Exact object counts vary in ways we can't predict. For example,
 // BaselineScripts can hold onto "template objects", which exist only to hold
 // the shape and type for newly created objects. When BaselineScripts are
 // discarded, these template objects go with them.
 //
 // So instead of expecting precise counts, we expect counts that are at least as
 // many as we would expect given the object graph we've built.
 //
 // Ported from js/src/jit-tests/debug/Memory-takeCensus-02.js
 
 function run_test() {
   // A Debugger with no debuggees had better not find anything.
-  var dbg = new Debugger;
-  var census0 = saveHeapSnapshotAndTakeCensus(dbg);
+  let dbg = new Debugger();
+  let census0 = saveHeapSnapshotAndTakeCensus(dbg);
   Census.walkCensus(census0, "census0", Census.assertAllZeros);
 
   function newGlobalWithDefs() {
-    var g = newGlobal();
+    let g = newGlobal();
     g.eval(`
            function times(n, fn) {
              var a=[];
              for (var i = 0; i<n; i++)
                a.push(fn());
              return a;
            }
            `);
     return g;
   }
 
   // Allocate a large number of various types of objects, and check that census
   // finds them.
-  var g = newGlobalWithDefs();
+  let g = newGlobalWithDefs();
   dbg.addDebuggee(g);
 
   g.eval("var objs = times(100, () => ({}));");
   g.eval("var rxs  = times(200, () => /foo/);");
   g.eval("var ars  = times(400, () => []);");
   g.eval("var fns  = times(800, () => () => {});");
 
-  var census1 = dbg.memory.takeCensus(dbg);
+  let census1 = dbg.memory.takeCensus(dbg);
   Census.walkCensus(census1, "census1",
-                    Census.assertAllNotLessThan(
-                      { "objects":
-                        { "Object":   { count: 100 },
-                          "RegExp":   { count: 200 },
-                          "Array":    { count: 400 },
-                          "Function": { count: 800 }
-                        }
-                      }));
+                    Census.assertAllNotLessThan({
+                      "objects": {
+                        "Object": { count: 100 },
+                        "RegExp": { count: 200 },
+                        "Array": { count: 400 },
+                        "Function": { count: 800 }
+                      }
+                    }));
 
   do_test_finished();
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js
@@ -1,34 +1,35 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.takeCensus behaves plausibly as we add and remove
 // debuggees.
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-03.js
 
 function run_test() {
-  var dbg = new Debugger;
+  let dbg = new Debugger();
 
-  var census0 = saveHeapSnapshotAndTakeCensus(dbg);
+  let census0 = saveHeapSnapshotAndTakeCensus(dbg);
   Census.walkCensus(census0, "census0", Census.assertAllZeros);
 
-  var g1 = newGlobal();
+  let g1 = newGlobal();
   dbg.addDebuggee(g1);
-  var census1 = saveHeapSnapshotAndTakeCensus(dbg);
+  let census1 = saveHeapSnapshotAndTakeCensus(dbg);
   Census.walkCensus(census1, "census1", Census.assertAllNotLessThan(census0));
 
-  var g2 = newGlobal();
+  let g2 = newGlobal();
   dbg.addDebuggee(g2);
-  var census2 = saveHeapSnapshotAndTakeCensus(dbg);
+  let census2 = saveHeapSnapshotAndTakeCensus(dbg);
   Census.walkCensus(census2, "census2", Census.assertAllNotLessThan(census1));
 
   dbg.removeDebuggee(g2);
-  var census3 = saveHeapSnapshotAndTakeCensus(dbg);
+  let census3 = saveHeapSnapshotAndTakeCensus(dbg);
   Census.walkCensus(census3, "census3", Census.assertAllEqual(census1));
 
   dbg.removeDebuggee(g1);
-  var census4 = saveHeapSnapshotAndTakeCensus(dbg);
+  let census4 = saveHeapSnapshotAndTakeCensus(dbg);
   Census.walkCensus(census4, "census4", Census.assertAllEqual(census0));
 
   do_test_finished();
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js
@@ -1,33 +1,34 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that HeapSnapshot.prototype.takeCensus finds GC roots that are on the
 // stack.
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-04.js
 
 function run_test() {
-  var g = newGlobal();
-  var dbg = new Debugger(g);
+  let g = newGlobal();
+  let dbg = new Debugger(g);
 
   g.eval(`
 function withAllocationMarkerOnStack(f) {
   (function () {
     var onStack = allocationMarker();
     f();
   }());
 }
 `);
 
   equal("AllocationMarker" in saveHeapSnapshotAndTakeCensus(dbg).objects, false,
         "There shouldn't exist any allocation markers in the census.");
 
-  var allocationMarkerCount;
+  let allocationMarkerCount;
   g.withAllocationMarkerOnStack(() => {
     const census = saveHeapSnapshotAndTakeCensus(dbg);
     allocationMarkerCount = census.objects.AllocationMarker.count;
   });
 
   equal(allocationMarkerCount, 1,
         "Should have one allocation marker in the census, because there " +
         "was one on the stack.");
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js
@@ -1,19 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test that HeapSnapshot.prototype.takeCensus finds cross compartment
 // wrapper GC roots.
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-05.js
 
+/* eslint-disable strict */
 function run_test() {
-  var g = newGlobal();
-  var dbg = new Debugger(g);
+  let g = newGlobal();
+  let dbg = new Debugger(g);
 
   equal("AllocationMarker" in saveHeapSnapshotAndTakeCensus(dbg).objects, false,
         "No allocation markers should exist in the census.");
 
   this.ccw = g.allocationMarker();
 
   const census = saveHeapSnapshotAndTakeCensus(dbg);
   equal(census.objects.AllocationMarker.count, 1,
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js
@@ -1,125 +1,128 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Check HeapSnapshot.prototype.takeCensus handling of 'breakdown' argument.
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-06.js
 
 function run_test() {
-  var Pattern = Match.Pattern;
+  let Pattern = Match.Pattern;
 
-  var g = newGlobal();
-  var dbg = new Debugger(g);
+  let g = newGlobal();
+  let dbg = new Debugger(g);
 
   Pattern({ count: Pattern.NATURAL,
             bytes: Pattern.NATURAL })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "count" } }));
 
-  let census = saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "count", count: false, bytes: false } });
+  let census = saveHeapSnapshotAndTakeCensus(dbg,
+    { breakdown: { by: "count", count: false, bytes: false } });
   equal("count" in census, false);
   equal("bytes" in census, false);
 
-  census = saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "count", count: true, bytes: false } });
+  census = saveHeapSnapshotAndTakeCensus(dbg,
+    { breakdown: { by: "count", count: true, bytes: false } });
   equal("count" in census, true);
   equal("bytes" in census, false);
 
-  census = saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "count", count: false, bytes: true } });
+  census = saveHeapSnapshotAndTakeCensus(dbg,
+    { breakdown: { by: "count", count: false, bytes: true } });
   equal("count" in census, false);
   equal("bytes" in census, true);
 
-  census = saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "count", count: true, bytes: true } });
+  census = saveHeapSnapshotAndTakeCensus(dbg,
+    { breakdown: { by: "count", count: true, bytes: true } });
   equal("count" in census, true);
   equal("bytes" in census, true);
 
-
   // Pattern doesn't mind objects with extra properties, so we'll restrict this
   // list to the object classes we're pretty sure are going to stick around for
   // the forseeable future.
   Pattern({
-    Function:       { count: Pattern.NATURAL },
-    Object:         { count: Pattern.NATURAL },
-    Debugger:       { count: Pattern.NATURAL },
-    Sandbox:        { count: Pattern.NATURAL },
+    Function: { count: Pattern.NATURAL },
+    Object: { count: Pattern.NATURAL },
+    Debugger: { count: Pattern.NATURAL },
+    Sandbox: { count: Pattern.NATURAL },
 
             // The below are all Debugger prototype objects.
-    Source:         { count: Pattern.NATURAL },
-    Environment:    { count: Pattern.NATURAL },
-    Script:         { count: Pattern.NATURAL },
-    Memory:         { count: Pattern.NATURAL },
-    Frame:          { count: Pattern.NATURAL }
+    Source: { count: Pattern.NATURAL },
+    Environment: { count: Pattern.NATURAL },
+    Script: { count: Pattern.NATURAL },
+    Memory: { count: Pattern.NATURAL },
+    Frame: { count: Pattern.NATURAL }
   })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "objectClass" } }));
 
   Pattern({
-    objects:        { count: Pattern.NATURAL },
-    scripts:        { count: Pattern.NATURAL },
-    strings:        { count: Pattern.NATURAL },
-    other:          { count: Pattern.NATURAL }
+    objects: { count: Pattern.NATURAL },
+    scripts: { count: Pattern.NATURAL },
+    strings: { count: Pattern.NATURAL },
+    other: { count: Pattern.NATURAL }
   })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "coarseType" } }));
 
   // As for { by: 'objectClass' }, restrict our pattern to the types
   // we predict will stick around for a long time.
   Pattern({
-    JSString:             { count: Pattern.NATURAL },
-    "js::Shape":          { count: Pattern.NATURAL },
-    JSObject:             { count: Pattern.NATURAL },
-    JSScript:             { count: Pattern.NATURAL }
+    JSString: { count: Pattern.NATURAL },
+    "js::Shape": { count: Pattern.NATURAL },
+    JSObject: { count: Pattern.NATURAL },
+    JSScript: { count: Pattern.NATURAL }
   })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "internalType" } }));
 
-
   // Nested breakdowns.
 
   let coarseTypePattern = {
-    objects:        { count: Pattern.NATURAL },
-    scripts:        { count: Pattern.NATURAL },
-    strings:        { count: Pattern.NATURAL },
-    other:          { count: Pattern.NATURAL }
+    objects: { count: Pattern.NATURAL },
+    scripts: { count: Pattern.NATURAL },
+    strings: { count: Pattern.NATURAL },
+    other: { count: Pattern.NATURAL }
   };
 
   Pattern({
-    JSString:    coarseTypePattern,
+    JSString: coarseTypePattern,
     "js::Shape": coarseTypePattern,
-    JSObject:    coarseTypePattern,
-    JSScript:    coarseTypePattern,
+    JSObject: coarseTypePattern,
+    JSScript: coarseTypePattern,
   })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, {
       breakdown: { by: "internalType",
                    then: { by: "coarseType" }
       }
     }));
 
   Pattern({
-    Function:       { count: Pattern.NATURAL },
-    Object:         { count: Pattern.NATURAL },
-    Debugger:       { count: Pattern.NATURAL },
-    Sandbox:        { count: Pattern.NATURAL },
-    other:          coarseTypePattern
+    Function: { count: Pattern.NATURAL },
+    Object: { count: Pattern.NATURAL },
+    Debugger: { count: Pattern.NATURAL },
+    Sandbox: { count: Pattern.NATURAL },
+    other: coarseTypePattern
   })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, {
       breakdown: {
         by: "objectClass",
-        then:  { by: "count" },
+        then: { by: "count" },
         other: { by: "coarseType" }
       }
     }));
 
   Pattern({
     objects: { count: Pattern.NATURAL, label: "object" },
     scripts: { count: Pattern.NATURAL, label: "scripts" },
     strings: { count: Pattern.NATURAL, label: "strings" },
-    other:   { count: Pattern.NATURAL, label: "other" }
+    other: { count: Pattern.NATURAL, label: "other" }
   })
     .assert(saveHeapSnapshotAndTakeCensus(dbg, {
       breakdown: {
         by: "coarseType",
         objects: { by: "count", label: "object" },
         scripts: { by: "count", label: "scripts" },
         strings: { by: "count", label: "strings" },
-        other:   { by: "count", label: "other" }
+        other: { by: "count", label: "other" }
       }
     }));
 
   do_test_finished();
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js
@@ -1,82 +1,95 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.takeCensus breakdown: check error handling on property
 // gets.
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-07.js
 
 function run_test() {
-  var g = newGlobal();
-  var dbg = new Debugger(g);
+  let g = newGlobal();
+  let dbg = new Debugger(g);
 
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { get by() { throw "ಠ_ಠ"; } }
+      breakdown: { get by() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-
-
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "count", get count() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "count", get count() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "count", get bytes() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "count", get bytes() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-
-
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "objectClass", get then() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "objectClass", get then() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "objectClass", get other() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "objectClass", get other() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-
-
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "coarseType", get objects() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "coarseType", get objects() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "coarseType", get scripts() { throw "ಠ_ಠ"; } }
-    });
-  }, "ಠ_ಠ");
-
-  assertThrowsValue(() => {
-    saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "coarseType", get strings() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "coarseType", get scripts() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "coarseType", get other() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "coarseType", get strings() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
-
+  assertThrows(() => {
+    saveHeapSnapshotAndTakeCensus(dbg, {
+      breakdown: { by: "coarseType", get other() {
+        throw Error("ಠ_ಠ");
+      } }
+    });
+  }, "ಠ_ಠ");
 
-  assertThrowsValue(() => {
+  assertThrows(() => {
     saveHeapSnapshotAndTakeCensus(dbg, {
-      breakdown: { by: "internalType", get then() { throw "ಠ_ಠ"; } }
+      breakdown: { by: "internalType", get then() {
+        throw Error("ಠ_ಠ");
+      } }
     });
   }, "ಠ_ಠ");
 
   do_test_finished();
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.takeCensus: test by: 'count' breakdown
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-08.js
 
 function run_test() {
   let g = newGlobal();
   let dbg = new Debugger(g);
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js
@@ -1,53 +1,56 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // HeapSnapshot.prototype.takeCensus: by: allocationStack breakdown
 //
 // Ported from js/src/jit-test/tests/debug/Memory-takeCensus-09.js
 
 function run_test() {
-  var g = newGlobal();
-  var dbg = new Debugger(g);
+  let g = newGlobal();
+  let dbg = new Debugger(g);
 
   g.eval(`                                              // 1
          var log = [];                                  // 2
          function f() { log.push(allocationMarker()); } // 3
          function g() { f(); }                          // 4
          function h() { f(); }                          // 5
-         `);                                            // 6
+         `);
 
   // Create one allocationMarker with tracking turned off,
   // so it will have no associated stack.
   g.f();
 
   dbg.memory.allocationSamplingProbability = 1;
 
-  for ([func, n] of [[g.f, 20], [g.g, 10], [g.h, 5]]) {
+  for (let [func, n] of [[g.f, 20], [g.g, 10], [g.h, 5]]) {
     for (let i = 0; i < n; i++) {
       dbg.memory.trackingAllocationSites = true;
       // All allocations of allocationMarker occur with this line as the oldest
       // stack frame.
       func();
       dbg.memory.trackingAllocationSites = false;
     }
   }
 
-  let census = saveHeapSnapshotAndTakeCensus(dbg, { breakdown: { by: "objectClass",
-                                                                 then: { by: "allocationStack",
-                                                                         then: { by: "count",
-                                                                                 label: "haz stack"
-                                                                               },
-                                                                         noStack: { by: "count",
-                                                                                    label: "no haz stack"
-                                                                                  }
-                                                                       }
-                                                               }
-                                                  });
+  let census = saveHeapSnapshotAndTakeCensus(
+    dbg, { breakdown: {
+      by: "objectClass",
+      then: {
+        by: "allocationStack",
+        then: { by: "count", label: "haz stack"},
+        noStack: {
+          by: "count",
+          label: "no haz stack"
+        }
+      }
+    }
+    });
 
   let map = census.AllocationMarker;
   ok(map instanceof Map, "Should be a Map instance");
   equal(map.size, 4, "Should have 4 allocation stacks (including the lack of a stack)");
 
   // Gather the stacks we are expecting to appear as keys, and
   // check that there are no unexpected keys.
   let stacks = { };
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Check byte counts produced by takeCensus.
 //
 // Ported from js/src/jit-test/tests/debug/Memory-take Census-10.js
 
 function run_test() {
   let g = newGlobal();
   let dbg = new Debugger(g);
@@ -20,27 +21,27 @@ function run_test() {
 
   g.eval(`                                  // 1
          var objs = [];                     // 2
          function fnerd() {                 // 3
            objs.push(allocationMarker());   // 4
            for (let i = 0; i < 10; i++)     // 5
              objs.push(allocationMarker()); // 6
          }                                  // 7
-         `);                                // 8
+         `);
 
   dbg.memory.allocationSamplingProbability = 1;
   dbg.memory.trackingAllocationSites = true;
   g.fnerd();
   dbg.memory.trackingAllocationSites = false;
 
   census = saveHeapSnapshotAndTakeCensus(dbg, {
     breakdown: { by: "objectClass",
                  then: { by: "allocationStack" }
-               }
+    }
   });
 
   let seen = 0;
   census.AllocationMarker.forEach((v, k) => {
     equal(k.functionDisplayName, "fnerd");
     switch (k.line) {
       case 4:
         equal(v.count, 1);
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js
@@ -1,47 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that Debugger.Memory.prototype.takeCensus and
 // HeapSnapshot.prototype.takeCensus return the same data for the same heap
 // graph.
 
 function doLiveAndOfflineCensus(g, dbg, opts) {
   dbg.memory.allocationSamplingProbability = 1;
   dbg.memory.trackingAllocationSites = true;
   g.eval(`                                          // 1
          (function unsafeAtAnySpeed() {             // 2
            for (var i = 0; i < 100; i++) {          // 3
              this.markers.push(allocationMarker()); // 4
            }                                        // 5
          }());                                      // 6
-         `);                                        // 7
+         `);
   dbg.memory.trackingAllocationSites = false;
 
   return {
     live: dbg.memory.takeCensus(opts),
     offline: saveHeapSnapshotAndTakeCensus(dbg, opts)
   };
 }
 
 function run_test() {
-  var g = newGlobal();
-  var dbg = new Debugger(g);
+  let g = newGlobal();
+  let dbg = new Debugger(g);
 
   g.eval("this.markers = []");
   const markerSize = byteSize(allocationMarker());
 
   // First, test that we get the same counts and sizes as we allocate and retain
   // more things.
 
   let prevCount = 0;
   let prevBytes = 0;
 
-  for (var i = 0; i < 10; i++) {
+  for (let i = 0; i < 10; i++) {
     const { live, offline } = doLiveAndOfflineCensus(g, dbg, {
       breakdown: { by: "objectClass",
                    then: { by: "count"} }
     });
 
     equal(live.AllocationMarker.count, offline.AllocationMarker.count);
     equal(live.AllocationMarker.bytes, offline.AllocationMarker.bytes);
     equal(live.AllocationMarker.count, prevCount + 100);
@@ -91,19 +92,18 @@ function run_test() {
     offlineEntries.push([k.toString(), v]);
   });
 
   const sortEntries = (a, b) => {
     if (a[0] < b[0]) {
       return -1;
     } else if (a[0] > b[0]) {
       return 1;
-    } else {
-      return 0;
     }
+    return 0;
   };
   liveEntries.sort(sortEntries);
   offlineEntries.sort(sortEntries);
 
   equal(liveEntries.length, live.AllocationMarker.size);
   equal(liveEntries.length, offlineEntries.length);
 
   for (let i = 0; i < liveEntries.length; i++) {
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that when we take a census and get a bucket list of ids that matched the
 // given category, that the returned ids are all in the snapshot and their
 // reported category.
 
 function run_test() {
   const g = newGlobal();
   const dbg = new Debugger(g);
--- a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test that we can read core dumps into HeapSnapshot instances.
-
+/* eslint-disable strict */
 if (typeof Debugger != "function") {
   const { addDebuggerToGlobal } = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
   addDebuggerToGlobal(this);
 }
 
 function run_test() {
   const filePath = ChromeUtils.saveHeapSnapshot({ globals: [this] });
   ok(true, "Should be able to save a snapshot.");
--- a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that we can save a core dump with allocation stacks and read it back
 // into a HeapSnapshot.
 
 if (typeof Debugger != "function") {
   const { addDebuggerToGlobal } = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
   addDebuggerToGlobal(this);
 }
--- a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test that we can read core dumps into HeapSnapshot instances in a worker.
-
+// eslint-disable-next-line
 add_task(function* () {
   const worker = new ChromeWorker("resource://test/heap-snapshot-worker.js");
   worker.postMessage({});
 
   let assertionCount = 0;
   worker.onmessage = e => {
     if (e.data.type !== "assertion") {
       return;
--- a/devtools/shared/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test the ChromeUtils interface.
-
+// eslint-disable-next-line
 if (typeof Debugger != "function") {
   const { addDebuggerToGlobal } = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
   addDebuggerToGlobal(this);
 }
 
 function run_test() {
   ok(ChromeUtils, "Should be able to get the ChromeUtils interface");
 
@@ -44,38 +44,39 @@ function testBadParameters() {
          "Should throw if globals is not an object.");
 
   throws(() => ChromeUtils.saveHeapSnapshot({ globals: {} }),
          "Should throw if globals is not an array.");
 
   throws(() => ChromeUtils.saveHeapSnapshot({ debugger: Debugger.prototype }),
          "Should throw if debugger is the Debugger.prototype object.");
 
-  throws(() => ChromeUtils.saveHeapSnapshot({ get globals() { return [this]; } }),
-         "Should throw if boundaries property is a getter.");
+  throws(() => ChromeUtils.saveHeapSnapshot({ get globals() {
+    return [this];
+  } }), "Should throw if boundaries property is a getter.");
 }
 
 const makeNewSandbox = () =>
   Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")());
 
 function testGoodParameters() {
   let sandbox = makeNewSandbox();
   let dbg = new Debugger(sandbox);
 
   ChromeUtils.saveHeapSnapshot({ debugger: dbg });
   ok(true, "Should be able to save a snapshot for a debuggee global.");
 
-  dbg = new Debugger;
+  dbg = new Debugger();
   let sandboxes = Array(10).fill(null).map(makeNewSandbox);
   sandboxes.forEach(sb => dbg.addDebuggee(sb));
 
   ChromeUtils.saveHeapSnapshot({ debugger: dbg });
   ok(true, "Should be able to save a snapshot for many debuggee globals.");
 
-  dbg = new Debugger;
+  dbg = new Debugger();
   ChromeUtils.saveHeapSnapshot({ debugger: dbg });
   ok(true, "Should be able to save a snapshot with no debuggee globals.");
 
   ChromeUtils.saveHeapSnapshot({ globals: [this] });
   ok(true, "Should be able to save a snapshot for a specific global.");
 
   ChromeUtils.saveHeapSnapshot({ runtime: true });
   ok(true, "Should be able to save a snapshot of the full runtime.");
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Tests CensusTreeNode with `internalType` breakdown.
  */
 
 const BREAKDOWN = {
   by: "internalType",
   then: { by: "count", count: true, bytes: true }
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Tests CensusTreeNode with `coarseType` breakdown.
  */
 
 const countBreakdown = { by: "count", count: true, bytes: true };
 
 const BREAKDOWN = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Tests CensusTreeNode with `objectClass` breakdown.
  */
 
 const countBreakdown = { by: "count", count: true, bytes: true };
 
 const BREAKDOWN = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Tests CensusTreeNode with `allocationStack` breakdown.
  */
 
 function run_test() {
   const countBreakdown = { by: "count", count: true, bytes: true };
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-05.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Tests CensusTreeNode with `allocationStack` => `objectClass` breakdown.
  */
 
 function run_test() {
   const countBreakdown = { by: "count", count: true, bytes: true };
 
@@ -24,21 +25,21 @@ function run_test() {
     (function b() {
       (function c() {
         stack = saveStack(3);
       }());
     }());
   }());
 
   const REPORT = new Map([
-    [stack, { Foo:   { bytes: 10, count: 1 },
-                  Bar:   { bytes: 20, count: 2 },
-                  Baz:   { bytes: 30, count: 3 },
-                  other: { bytes: 40, count: 4 }
-                }],
+    [stack, { Foo: { bytes: 10, count: 1 },
+              Bar: { bytes: 20, count: 2 },
+              Baz: { bytes: 30, count: 3 },
+              other: { bytes: 40, count: 4 }
+    }],
     ["noStack", { bytes: 50, count: 5 }],
   ]);
 
   const EXPECTED = {
     name: null,
     bytes: 0,
     totalBytes: 150,
     count: 0,
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-06.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-06.js
@@ -1,24 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Test inverting CensusTreeNode with a by alloaction stack breakdown.
  */
 
 function run_test() {
   const BREAKDOWN = {
     by: "allocationStack",
     then: { by: "count", count: true, bytes: true },
     noStack: { by: "count", count: true, bytes: true },
   };
 
-  let stack1, stack2, stack3, stack4;
-
   function a(n) {
     return b(n);
   }
   function b(n) {
     return c(n);
   }
   function c(n) {
     return saveStack(n);
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-07.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-07.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Test inverting CensusTreeNode with a non-allocation stack breakdown.
  */
 
 function run_test() {
   const BREAKDOWN = {
     by: "coarseType",
@@ -16,17 +17,17 @@ function run_test() {
     scripts: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
     strings: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
-    other:{
+    other: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
   };
 
   const REPORT = {
     objects: {
       Array: { bytes: 50, count: 5 },
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-08.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-08.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 /**
  * Test inverting CensusTreeNode with a non-allocation stack breakdown.
  */
 
 function run_test() {
   const BREAKDOWN = {
     by: "filename",
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_diff_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test diffing census reports of breakdown by "internalType".
 
 const BREAKDOWN = {
   by: "internalType",
   then: { by: "count", count: true, bytes: true }
 };
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_diff_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test diffing census reports of breakdown by "count".
 
 const BREAKDOWN = { by: "count", count: true, bytes: true };
 
 const REPORT1 = {
   "count": 10,
   "bytes": 100,
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_diff_03.js
@@ -1,19 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test diffing census reports of breakdown by "coarseType".
 
 const BREAKDOWN = {
   by: "coarseType",
   objects: { by: "count", count: true, bytes: true },
   scripts: { by: "count", count: true, bytes: true },
   strings: { by: "count", count: true, bytes: true },
-  other:   { by: "count", count: true, bytes: true },
+  other: { by: "count", count: true, bytes: true },
 };
 
 const REPORT1 = {
   objects: {
     count: 1,
     bytes: 10,
   },
   scripts: {
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_diff_04.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test diffing census reports of breakdown by "objectClass".
 
 const BREAKDOWN = {
   by: "objectClass",
   then: { by: "count", count: true, bytes: true },
   other: { by: "count", count: true, bytes: true },
 };
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_diff_05.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test diffing census reports of breakdown by "allocationStack".
 
 const BREAKDOWN = {
   by: "allocationStack",
   then: { by: "count", count: true, bytes: true },
   noStack: { by: "count", count: true, bytes: true },
 };
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_06.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_diff_06.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test diffing census reports of a "complex" and "realistic" breakdown.
 
 const BREAKDOWN = {
   by: "coarseType",
   objects: {
     by: "allocationStack",
     then: {
@@ -36,21 +37,21 @@ const stack1 = saveStack();
 const stack2 = saveStack();
 const stack3 = saveStack();
 
 const REPORT1 = {
   objects: new Map([
     [stack1, { Function: { bytes: 1 },
                Object: { bytes: 2 },
                other: { bytes: 0 },
-             }],
+    }],
     [stack2, { Array: { bytes: 3 },
                Date: { bytes: 4 },
                other: { bytes: 0 },
-             }],
+    }],
     ["noStack", { Object: { bytes: 3 }}],
   ]),
   strings: {
     JSAtom: { bytes: 10 },
     JSLinearString: { bytes: 5 },
   },
   scripts: {
     JSScript: { bytes: 1 },
@@ -61,21 +62,21 @@ const REPORT1 = {
   }
 };
 
 const REPORT2 = {
   objects: new Map([
     [stack2, { Array: { bytes: 1 },
                Date: { bytes: 2 },
                other: { bytes: 3 },
-             }],
+    }],
     [stack3, { Function: { bytes: 1 },
                Object: { bytes: 2 },
                other: { bytes: 0 },
-             }],
+    }],
     ["noStack", { Object: { bytes: 3 }}],
   ]),
   strings: {
     JSAtom: { bytes: 5 },
     JSLinearString: { bytes: 10 },
   },
   scripts: {
     JSScript: { bytes: 2 },
@@ -87,25 +88,25 @@ const REPORT2 = {
   }
 };
 
 const EXPECTED = {
   "objects": new Map([
     [stack1, { Function: { bytes: -1 },
                Object: { bytes: -2 },
                other: { bytes: 0 },
-             }],
+    }],
     [stack2, { Array: { bytes: -2 },
                Date: { bytes: -2 },
                other: { bytes: 3 },
-             }],
+    }],
     [stack3, { Function: { bytes: 1 },
                Object: { bytes: 2 },
                other: { bytes: 0 },
-             }],
+    }],
     ["noStack", { Object: { bytes: 0 }}],
   ]),
   "scripts": {
     "JSScript": {
       "bytes": 1
     },
     "js::jit::JitCode": {
       "bytes": -1
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_01.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test filtering basic CensusTreeNode trees.
 
 function run_test() {
   const BREAKDOWN = {
     by: "coarseType",
     objects: {
       by: "objectClass",
@@ -14,17 +15,17 @@ function run_test() {
     scripts: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
     strings: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
-    other:{
+    other: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
   };
 
   const REPORT = {
     objects: {
       Array: { bytes: 50, count: 5 },
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test filtering CensusTreeNode trees with an `allocationStack` breakdown.
 
 function run_test() {
   const countBreakdown = { by: "count", count: true, bytes: true };
 
   const BREAKDOWN = {
     by: "allocationStack",
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_03.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_03.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test filtering with no matches.
 
 function run_test() {
   const BREAKDOWN = {
     by: "coarseType",
     objects: {
       by: "objectClass",
@@ -14,17 +15,17 @@ function run_test() {
     scripts: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
     strings: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
-    other:{
+    other: {
       by: "internalType",
       then: { by: "count", count: true, bytes: true },
     },
   };
 
   const REPORT = {
     objects: {
       Array: { bytes: 50, count: 5 },
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_04.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test the filtered nodes' counts and bytes are the same as they were when
 // unfiltered.
 
 function run_test() {
   const COUNT = { by: "count", count: true, bytes: true };
   const INTERNAL_TYPE = { by: "internalType", then: COUNT };
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_05.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_05.js
@@ -1,10 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test that filtered and inverted allocation stack census trees are sorted
 // properly.
 
 function run_test() {
   const countBreakdown = { by: "count", count: true, bytes: true };
 
   const BREAKDOWN = {
--- a/devtools/shared/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js
@@ -1,11 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
+// eslint-disable no-inline-comments
 
 // Test basic functionality of `CensusUtils.getCensusIndividuals`.
 
 function run_test() {
   const stack1 = saveStack(1);
   const stack2 = saveStack(1);
   const stack3 = saveStack(1);
 
@@ -19,16 +20,17 @@ function run_test() {
   };
 
   const MOCK_SNAPSHOT = {
     takeCensus: ({ breakdown }) => {
       assertStructurallyEquivalent(
         breakdown,
         CensusUtils.countToBucketBreakdown(BREAKDOWN));
 
+      /* eslint-disable */
       //                                DFS Index
       return new Map([               // 0
         [stack1, {                   // 1
           JSObject: [101, 102, 103], // 2
           JSString: [111, 112, 113], // 3
         }],
         [stack2, {                   // 4
           JSObject: [201, 202, 203], // 5
@@ -38,16 +40,17 @@ function run_test() {
           JSObject: [301, 302, 303], // 8
           JSString: [311, 312, 313], // 9
         }],
         ["noStack", {                // 10
           JSObject: [401, 402, 403], // 11
           JSString: [411, 412, 413], // 12
         }],
       ]);
+      /* eslint-enable */
     }
   };
 
   const INDICES = new Set([3, 5, 9]);
 
   const EXPECTED = new Set([111, 112, 113,
                             201, 202, 203,
                             311, 312, 313]);
--- a/devtools/shared/heapsnapshot/tests/unit/test_getReportLeaves_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_getReportLeaves_01.js
@@ -58,17 +58,18 @@ function run_test() {
   const root = censusReportToCensusTreeNode(BREAKDOWN, REPORT);
   dumpn("CensusTreeNode tree = " + JSON.stringify(root, null, 4));
 
   (function assertEveryNodeCanFindItsLeaf(node) {
     if (node.reportLeafIndex) {
       const [ leaf ] = CensusUtils.getReportLeaves(new Set([node.reportLeafIndex]),
                                                    BREAKDOWN,
                                                    REPORT);
-      ok(leaf, "Should be able to find leaf for a node with a reportLeafIndex = " + node.reportLeafIndex);
+      ok(leaf, "Should be able to find leaf "
+        + "for a node with a reportLeafIndex = " + node.reportLeafIndex);
     }
 
     if (node.children) {
       for (let child of node.children) {
         assertEveryNodeCanFindItsLeaf(child);
       }
     }
   }(root));
@@ -83,16 +84,18 @@ function run_test() {
     if (node.children) {
       for (let child of node.children) {
         const found = find(name, child);
         if (found) {
           return found;
         }
       }
     }
+
+    return undefined;
   }
 
   const arrayNode = find("Array", root);
   ok(arrayNode);
   equal(typeof arrayNode.reportLeafIndex, "number");
 
   const shapeNode = find("js::Shape", root);
   ok(shapeNode);
--- a/devtools/shared/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js
@@ -1,8 +1,9 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
 
 // Test saving a heap snapshot in the sandboxed e10s child process.
 
 function run_test() {
   run_test_in_child("../unit/test_SaveHeapSnapshot.js");
 }