summaryrefslogtreecommitdiffstats
path: root/devtools/shared/test-helpers/allocation-tracker.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/shared/test-helpers/allocation-tracker.js')
-rw-r--r--devtools/shared/test-helpers/allocation-tracker.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/devtools/shared/test-helpers/allocation-tracker.js b/devtools/shared/test-helpers/allocation-tracker.js
index 17dcfafdf0..345eb23a43 100644
--- a/devtools/shared/test-helpers/allocation-tracker.js
+++ b/devtools/shared/test-helpers/allocation-tracker.js
@@ -41,7 +41,8 @@ const MemoryReporter = Cc["@mozilla.org/memory-reporter-manager;1"].getService(
const global = Cu.getGlobalForObject(this);
const { addDebuggerToGlobal } = ChromeUtils.importESModule(
- "resource://gre/modules/jsdebugger.sys.mjs"
+ "resource://gre/modules/jsdebugger.sys.mjs",
+ { global: "contextual" }
);
addDebuggerToGlobal(global);
@@ -313,14 +314,14 @@ exports.allocationTracker = function ({
logAllocationSites(message, sources, { first = 1000 } = {}) {
const allocationList = Object.entries(sources)
// Sort by number of total object
- .sort(([srcA, itemA], [srcB, itemB]) => itemB.count - itemA.count)
+ .sort(([, itemA], [, itemB]) => itemB.count - itemA.count)
// Keep only the first n-th sources, with the most allocations
.filter((_, i) => i < first)
.map(([src, item]) => {
const lines = [];
Object.entries(item.lines)
// Filter out lines where we only freed objects
- .filter(([line, count]) => count > 0)
+ .filter(([, count]) => count > 0)
.sort(([lineA, countA], [lineB, countB]) => {
if (countA != countB) {
return countB - countA;