| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,12 +2,18 @@ | |||
| 2 | 2 | ||
| 3 | 3 | const { | |
| 4 | 4 | ArrayIsArray, | |
| 5 | + ArrayPrototypeFilter, | ||
| 6 | + ArrayPrototypeIncludes, | ||
| 7 | + ArrayPrototypeMap, | ||
| 8 | + ArrayPrototypePush, | ||
| 9 | + ArrayPrototypeSplice, | ||
| 10 | + ArrayPrototypeUnshift, | ||
| 5 | 11 | Boolean, | |
| 6 | 12 | NumberIsSafeInteger, | |
| 7 | 13 | ObjectDefineProperties, | |
| 8 | 14 | ObjectDefineProperty, | |
| 9 | 15 | ObjectKeys, | |
| 10 | - Set, | ||
| 16 | + SafeSet, | ||
| 11 | 17 | Symbol, | |
| 12 | 18 | } = primordials; | |
| 13 | 19 | ||
@@ -394,7 +400,9 @@ class PerformanceObserver extends AsyncResource { | |||
| 394 | 400 | if (!ArrayIsArray(entryTypes)) { | |
| 395 | 401 | throw new ERR_INVALID_ARG_VALUE('options.entryTypes', entryTypes); | |
| 396 | 402 | } | |
| 397 | - const filteredEntryTypes = entryTypes.filter(filterTypes).map(mapTypes); | ||
| 403 | + const filteredEntryTypes = | ||
| 404 | + ArrayPrototypeMap(ArrayPrototypeFilter(entryTypes, filterTypes), | ||
| 405 | + mapTypes); | ||
| 398 | 406 | if (filteredEntryTypes.length === 0) { | |
| 399 | 407 | throw new ERR_VALID_PERFORMANCE_ENTRY_TYPE(); | |
| 400 | 408 | } | |
@@ -421,7 +429,7 @@ class PerformanceObserver extends AsyncResource { | |||
| 421 | 429 | class Performance { | |
| 422 | 430 | constructor() { | |
| 423 | 431 | this[kIndex] = { | |
| 424 | - [kMarks]: new Set() | ||
| 432 | + [kMarks]: new SafeSet() | ||
| 425 | 433 | }; | |
| 426 | 434 | } | |
| 427 | 435 | ||
@@ -588,7 +596,7 @@ function observersCallback(entry) { | |||
| 588 | 596 | setupObservers(observersCallback); | |
| 589 | 597 | ||
| 590 | 598 | function filterTypes(i) { | |
| 591 | - return observerableTypes.indexOf(`${i}`) >= 0; | ||
| 599 | + return ArrayPrototypeIncludes(observerableTypes, `${i}`); | ||
| 592 | 600 | } | |
| 593 | 601 | ||
| 594 | 602 | function mapTypes(i) { | |
@@ -626,15 +634,15 @@ function sortedInsert(list, entry) { | |||
| 626 | 634 | const entryStartTime = entry.startTime; | |
| 627 | 635 | if (list.length === 0 || | |
| 628 | 636 | (list[list.length - 1].startTime < entryStartTime)) { | |
| 629 | - list.push(entry); | ||
| 637 | + ArrayPrototypePush(list, entry); | ||
| 630 | 638 | return; | |
| 631 | 639 | } | |
| 632 | 640 | if (list[0] && (list[0].startTime > entryStartTime)) { | |
| 633 | - list.unshift(entry); | ||
| 641 | + ArrayPrototypeUnshift(list, entry); | ||
| 634 | 642 | return; | |
| 635 | 643 | } | |
| 636 | 644 | const location = getInsertLocation(list, entryStartTime); | |
| 637 | - list.splice(location, 0, entry); | ||
| 645 | + ArrayPrototypeSplice(list, location, 0, entry); | ||
| 638 | 646 | } | |
| 639 | 647 | ||
| 640 | 648 | class ELDHistogram extends Histogram { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments