summaryrefslogtreecommitdiffstats
path: root/devtools/shared/test-helpers/allocation-tracker.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /devtools/shared/test-helpers/allocation-tracker.js
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;