33const {
44 ArrayIsArray,
55 ArrayPrototypeFilter,
6+ ArrayPrototypeForEach,
67 ArrayPrototypeIncludes,
78 ArrayPrototypeMap,
89 ArrayPrototypePush,
@@ -367,13 +368,13 @@ class PerformanceObserver extends AsyncResource {
367368disconnect ( ) {
368369const observerCountsGC = observerCounts [ NODE_PERFORMANCE_ENTRY_TYPE_GC ] ;
369370const types = this [ kTypes ] ;
370- for ( const key of ObjectKeys ( types ) ) {
371+ ArrayPrototypeForEach ( ObjectKeys ( types ) , ( key ) => {
371372const item = types [ key ] ;
372373if ( item ) {
373374L . remove ( item ) ;
374375observerCounts [ key ] -- ;
375376}
376- }
377+ } ) ;
377378this [ kTypes ] = { } ;
378379if ( observerCountsGC === 1 &&
379380observerCounts [ NODE_PERFORMANCE_ENTRY_TYPE_GC ] === 0 ) {
@@ -400,14 +401,14 @@ class PerformanceObserver extends AsyncResource {
400401this [ kBuffer ] [ kEntries ] = [ ] ;
401402L . init ( this [ kBuffer ] [ kEntries ] ) ;
402403this [ kBuffering ] = Boolean ( options . buffered ) ;
403- for ( const entryType of filteredEntryTypes ) {
404+ ArrayPrototypeForEach ( filteredEntryTypes , ( entryType ) => {
404405const list = getObserversList ( entryType ) ;
405- if ( this [ kTypes ] [ entryType ] ) continue ;
406+ if ( this [ kTypes ] [ entryType ] ) return ;
406407const item = { obs : this } ;
407408this [ kTypes ] [ entryType ] = item ;
408409L . append ( list , item ) ;
409410observerCounts [ entryType ] ++ ;
410- }
411+ } ) ;
411412if ( observerCountsGC === 0 &&
412413observerCounts [ NODE_PERFORMANCE_ENTRY_TYPE_GC ] === 1 ) {
413414installGarbageCollectionTracking ( ) ;
@@ -635,6 +636,7 @@ function sortedInsert(list, entry) {
635636}
636637
637638class ELDHistogram extends Histogram {
639+ constructor ( i ) { super ( i ) ; } // eslint-disable-line no-useless-constructor
638640enable ( ) { return this [ kHandle ] . enable ( ) ; }
639641disable ( ) { return this [ kHandle ] . disable ( ) ; }
640642}
0 commit comments