44 Array,
55 ArrayIsArray,
66 ArrayPrototypeFilter,
7+ ArrayPrototypeForEach,
78 ArrayPrototypePush,
89 ArrayPrototypeSort,
910 ArrayPrototypeUnshift,
@@ -462,12 +463,13 @@ function strEscape(str) {
462463// instead wrap the text in double quotes. If double quotes exist, check for
463464// backticks. If they do not exist, use those as fallback instead of the
464465// double quotes.
465- if ( str . includes ( "'" ) ) {
466+ if ( StringPrototypeIncludes ( str , "'" ) ) {
466467// This invalidates the charCode and therefore can not be matched for
467468// anymore.
468- if ( ! str . includes ( '"' ) ) {
469+ if ( ! StringPrototypeIncludes ( str , '"' ) ) {
469470singleQuote = - 1 ;
470- } else if ( ! str . includes ( '`' ) && ! str . includes ( '${' ) ) {
471+ } else if ( ! StringPrototypeIncludes ( str , '`' ) &&
472+ ! StringPrototypeIncludes ( str , '${' ) ) {
471473singleQuote = - 2 ;
472474}
473475if ( singleQuote !== 39 ) {
@@ -488,7 +490,7 @@ function strEscape(str) {
488490let last = 0 ;
489491const lastIndex = str . length ;
490492for ( let i = 0 ; i < lastIndex ; i ++ ) {
491- const point = str . charCodeAt ( i ) ;
493+ const point = StringPrototypeCharCodeAt ( str , i ) ;
492494if ( point === singleQuote ||
493495point === 92 ||
494496point < 32 ||
@@ -609,13 +611,13 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
609611if ( depth === 0 ) {
610612keySet = new SafeSet ( ) ;
611613} else {
612- keys . forEach ( ( key ) => keySet . add ( key ) ) ;
614+ ArrayPrototypeForEach ( keys , ( key ) => keySet . add ( key ) ) ;
613615}
614616// Get all own property names and symbols.
615617keys = ObjectGetOwnPropertyNames ( obj ) ;
616618const symbols = ObjectGetOwnPropertySymbols ( obj ) ;
617619if ( symbols . length !== 0 ) {
618- keys . push ( ...symbols ) ;
620+ ArrayPrototypePush ( keys , ...symbols ) ;
619621}
620622for ( const key of keys ) {
621623// Ignore the `constructor` property and keys that exist on layers above.
@@ -632,9 +634,9 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
632634ctx , obj , recurseTimes , key , kObjectType , desc , main ) ;
633635if ( ctx . colors ) {
634636// Faint!
635- output . push ( `\u001b[2m${ value } \u001b[22m` ) ;
637+ ArrayPrototypePush ( output , `\u001b[2m${ value } \u001b[22m` ) ;
636638} else {
637- output . push ( value ) ;
639+ ArrayPrototypePush ( output , value ) ;
638640}
639641}
640642// Limit the inspection to up to three prototype layers. Using `recurseTimes`
0 commit comments