|
4 | 4 | Array, |
5 | 5 | ArrayIsArray, |
6 | 6 | ArrayPrototypeFilter, |
| 7 | + ArrayPrototypeForEach, |
7 | 8 | ArrayPrototypePush, |
8 | 9 | ArrayPrototypeSort, |
9 | 10 | ArrayPrototypeUnshift, |
@@ -462,12 +463,13 @@ function strEscape(str) { |
462 | 463 | // instead wrap the text in double quotes. If double quotes exist, check for |
463 | 464 | // backticks. If they do not exist, use those as fallback instead of the |
464 | 465 | // double quotes. |
465 | | - if (str.includes("'")) { |
| 466 | + if (StringPrototypeIncludes(str, "'")) { |
466 | 467 | // This invalidates the charCode and therefore can not be matched for |
467 | 468 | // anymore. |
468 | | - if (!str.includes('"')) { |
| 469 | + if (!StringPrototypeIncludes(str, '"')) { |
469 | 470 | singleQuote = -1; |
470 | | - } else if (!str.includes('`') && !str.includes('${')) { |
| 471 | + } else if (!StringPrototypeIncludes(str, '`') && |
| 472 | + !StringPrototypeIncludes(str, '${')) { |
471 | 473 | singleQuote = -2; |
472 | 474 | } |
473 | 475 | if (singleQuote !== 39) { |
@@ -488,7 +490,7 @@ function strEscape(str) { |
488 | 490 | let last = 0; |
489 | 491 | const lastIndex = str.length; |
490 | 492 | for (let i = 0; i < lastIndex; i++) { |
491 | | - const point = str.charCodeAt(i); |
| 493 | + const point = StringPrototypeCharCodeAt(str, i); |
492 | 494 | if (point === singleQuote || |
493 | 495 | point === 92 || |
494 | 496 | point < 32 || |
@@ -609,13 +611,13 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) { |
609 | 611 | if (depth === 0) { |
610 | 612 | keySet = new SafeSet(); |
611 | 613 | } else { |
612 | | - keys.forEach((key) => keySet.add(key)); |
| 614 | + ArrayPrototypeForEach(keys, (key) => keySet.add(key)); |
613 | 615 | } |
614 | 616 | // Get all own property names and symbols. |
615 | 617 | keys = ObjectGetOwnPropertyNames(obj); |
616 | 618 | const symbols = ObjectGetOwnPropertySymbols(obj); |
617 | 619 | if (symbols.length !== 0) { |
618 | | - keys.push(...symbols); |
| 620 | + ArrayPrototypePush(keys, ...symbols); |
619 | 621 | } |
620 | 622 | for (const key of keys) { |
621 | 623 | // Ignore the `constructor` property and keys that exist on layers above. |
@@ -632,9 +634,9 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) { |
632 | 634 | ctx, obj, recurseTimes, key, kObjectType, desc, main); |
633 | 635 | if (ctx.colors) { |
634 | 636 | // Faint! |
635 | | - output.push(`\u001b[2m${value}\u001b[22m`); |
| 637 | + ArrayPrototypePush(output, `\u001b[2m${value}\u001b[22m`); |
636 | 638 | } else { |
637 | | - output.push(value); |
| 639 | + ArrayPrototypePush(output, value); |
638 | 640 | } |
639 | 641 | } |
640 | 642 | // Limit the inspection to up to three prototype layers. Using `recurseTimes` |
|