File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11function sendWebVitals ( ) {
22
33 function getLoafAttribution ( attribution ) {
4- if ( ! attribution ?. longAnimationFrameEntries ) {
4+ const loafEntriesLength = attribution ?. longAnimationFrameEntries ?. length || 0 ;
5+ if ( loafEntriesLength === 0 ) {
56 return { } ;
67 }
78
@@ -10,7 +11,7 @@ function sendWebVitals() {
1011 } ;
1112
1213 // The last LoAF entry is usually the most relevant.
13- const loaf = attribution . longAnimationFrameEntries . at ( - 1 )
14+ const loaf = attribution . longAnimationFrameEntries . at ( - 1 ) ;
1415 const loafEndTime = loaf . startTime + loaf . duration ;
1516 loaf . scripts . forEach ( script => {
1617 if ( script . duration <= loafAttribution . debug_loaf_script_total_duration ) {
@@ -38,7 +39,7 @@ function sendWebVitals() {
3839 debug_loaf_script_source_char_position : script . sourceCharPosition ,
3940
4041 // LoAF metadata.
41- debug_loaf_meta_length : attribution . longAnimationFrameEntries . length ,
42+ debug_loaf_meta_length : loafEntriesLength ,
4243 }
4344 } ) ;
4445
You can’t perform that action at this time.
0 commit comments