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

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 8445e62d03fc6af7cd28df2ca4b3a799acedf6e0..d05376f5d6ce4e86f1c458d16108e63c93ecabaa 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 Array.from(causeToInvalidationMap.values());
lushnikov 2016/07/20 03:02:50 valuesArray
kozy 2016/07/20 17:55:19 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698