3
3
const {
4
4
ArrayIsArray,
5
5
ArrayPrototypeFilter,
6
+ ArrayPrototypeForEach,
6
7
ArrayPrototypeIncludes,
7
8
ArrayPrototypeMap,
8
9
ArrayPrototypePush,
@@ -375,13 +376,13 @@ class PerformanceObserver {
375
376
disconnect ( ) {
376
377
const observerCountsGC = observerCounts [ NODE_PERFORMANCE_ENTRY_TYPE_GC ] ;
377
378
const types = this [ kTypes ] ;
378
- for ( const key of ObjectKeys ( types ) ) {
379
+ ArrayPrototypeForEach ( ObjectKeys ( types ) , ( key ) => {
379
380
const item = types [ key ] ;
380
381
if ( item ) {
381
382
L . remove ( item ) ;
382
383
observerCounts [ key ] -- ;
383
384
}
384
- }
385
+ } ) ;
385
386
this [ kTypes ] = { } ;
386
387
if ( observerCountsGC === 1 &&
387
388
observerCounts [ NODE_PERFORMANCE_ENTRY_TYPE_GC ] === 0 ) {
@@ -408,14 +409,14 @@ class PerformanceObserver {
408
409
this [ kBuffer ] [ kEntries ] = [ ] ;
409
410
L . init ( this [ kBuffer ] [ kEntries ] ) ;
410
411
this [ kBuffering ] = Boolean ( options . buffered ) ;
411
- for ( const entryType of filteredEntryTypes ) {
412
+ ArrayPrototypeForEach ( filteredEntryTypes , ( entryType ) => {
412
413
const list = getObserversList ( entryType ) ;
413
- if ( this [ kTypes ] [ entryType ] ) continue ;
414
+ if ( this [ kTypes ] [ entryType ] ) return ;
414
415
const item = { obs : this } ;
415
416
this [ kTypes ] [ entryType ] = item ;
416
417
L . append ( list , item ) ;
417
418
observerCounts [ entryType ] ++ ;
418
- }
419
+ } ) ;
419
420
if ( observerCountsGC === 0 &&
420
421
observerCounts [ NODE_PERFORMANCE_ENTRY_TYPE_GC ] === 1 ) {
421
422
installGarbageCollectionTracking ( ) ;
@@ -640,6 +641,7 @@ function sortedInsert(list, entry) {
640
641
}
641
642
642
643
class ELDHistogram extends Histogram {
644
+ constructor ( i ) { super ( i ) ; } // eslint-disable-line no-useless-constructor
643
645
enable ( ) { return this [ kHandle ] . enable ( ) ; }
644
646
disable ( ) { return this [ kHandle ] . disable ( ) ; }
645
647
}
0 commit comments