diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /devtools/shared/test-helpers/allocation-tracker.js | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/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.js | 7 |
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; |