Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2163093003: [DevTools] Remove Object.values and Object.isEmpty from utilities.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
index d820098231ae3e51260606272314989201bff53b..fdf6374e04e73734d0bce0d8b611d8b8f5110371 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
@@ -1156,11 +1156,13 @@ WebInspector.TimelineUIUtils._generateInvalidationsForType = function(type, targ
contentHelper.appendElementRow(title, invalidationsTreeOutline.element, false, true);
/**
- * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations
+ * @param {!Array<!WebInspector.InvalidationTrackingEvent>} invalidations
+ * @return {!Array<!Array<!WebInspector.InvalidationTrackingEvent>>}
*/
function groupInvalidationsByCause(invalidations)
{
- var causeToInvalidationMap = {};
+ /** @type {!Map<string, !Array<!WebInspector.InvalidationTrackingEvent>>} */
+ var causeToInvalidationMap = new Map();
for (var index = 0; index < invalidations.length; index++) {
var invalidation = invalidations[index];
var causeKey = "";
@@ -1176,12 +1178,12 @@ WebInspector.TimelineUIUtils._generateInvalidationsForType = function(type, targ
});
}
- if (causeToInvalidationMap[causeKey])
- causeToInvalidationMap[causeKey].push(invalidation);
+ if (causeToInvalidationMap.has(causeKey))
+ causeToInvalidationMap.get(causeKey).push(invalidation);
else
- causeToInvalidationMap[causeKey] = [ invalidation ];
+ causeToInvalidationMap.set(causeKey, [ invalidation ]);
}
- return Object.values(causeToInvalidationMap);
+ return causeToInvalidationMap.valuesArray();
}
}

Powered by Google App Engine
This is Rietveld 408576698