Skip to content

Commit ecbfd75

Browse files
committed
Only the relevant fields of the PerformanceTiming object get cloned
1 parent 1e46e37 commit ecbfd75

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/js/tracker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,10 @@
591591
// performance.timing so we cannot copy them using lodash.clone
592592
var performanceTiming = {};
593593
for (var field in performance.timing) {
594-
performanceTiming[field] = performance.timing[field];
594+
// Don't copy the toJSON method
595+
if (!lodash.isFunction(performance.timing[field])) {
596+
performanceTiming[field] = performance.timing[field];
597+
}
595598
}
596599

597600
// Old Chrome versions add an unwanted requestEnd field

0 commit comments

Comments
 (0)