Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Fix Object.entries not available in old browsers
Browse files Browse the repository at this point in the history
 🐿 v2.12.0
  • Loading branch information
carlesandres committed Mar 4, 2019
1 parent aaa02fb commit 093484c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/n-ui/ads/js/page-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ const sendPageMetricsWhenPageReady = () => {

const sendMetrics = () => {
const performance = window.performance || window.msPerformance || window.webkitPerformance || window.mozPerformance;
const marks = getPagePerfMarks(Object.values(eventToPerfmarkMap));
let pageMetricsMarkNames = [];

for (const key in eventToPerfmarkMap) {
pageMetricsMarkNames.push(eventToPerfmarkMap[key]);
}

const marks = getPerfMarks(pageMetricsMarkNames);

if (inMetricsSample()) {
broadcast('oTracking.event', {
Expand All @@ -48,7 +54,7 @@ const sendMetrics = () => {
}
};

const getPagePerfMarks = (markNames) => {
const getPerfMarks = (markNames) => {
if (!performance || !performance.getEntriesByName) {
return {};
}
Expand Down

0 comments on commit 093484c

Please sign in to comment.