@@ -23,16 +23,15 @@ const {
2323 ObjectKeys,
2424 ObjectValues,
2525 Promise,
26- PromiseAll,
2726 PromisePrototypeCatch,
2827 PromisePrototypeThen,
2928 PromiseResolve,
3029 ReflectGetOwnPropertyDescriptor,
3130 ReflectOwnKeys,
3231 RegExpPrototypeExec,
3332 RegExpPrototypeSymbolReplace,
34- SafeArrayIterator,
3533 SafeMap,
34+ SafePromiseAll,
3635 String,
3736 StringFromCharCode,
3837 StringPrototypeEndsWith,
@@ -519,22 +518,19 @@ function createRepl(inspector) {
519518 }
520519
521520 loadScopes ( ) {
522- return PromiseAll (
523- new SafeArrayIterator ( ArrayPrototypeMap (
524- ArrayPrototypeFilter (
525- this . scopeChain ,
526- ( scope ) => scope . type !== 'global'
527- ) ,
528- async ( scope ) => {
529- const { objectId } = scope . object ;
530- const { result } = await Runtime . getProperties ( {
531- objectId,
532- generatePreview : true ,
533- } ) ;
534- return new ScopeSnapshot ( scope , result ) ;
535- } )
536- )
537- ) ;
521+ return SafePromiseAll (
522+ ArrayPrototypeFilter (
523+ this . scopeChain ,
524+ ( scope ) => scope . type !== 'global'
525+ ) ,
526+ async ( scope ) => {
527+ const { objectId } = scope . object ;
528+ const { result } = await Runtime . getProperties ( {
529+ objectId,
530+ generatePreview : true ,
531+ } ) ;
532+ return new ScopeSnapshot ( scope , result ) ;
533+ } ) ;
538534 }
539535
540536 list ( delta = 5 ) {
@@ -661,8 +657,7 @@ function createRepl(inspector) {
661657 ( error ) => `<${ error . message } >` ) ;
662658 const lastIndex = watchedExpressions . length - 1 ;
663659
664- const values = await PromiseAll ( new SafeArrayIterator (
665- ArrayPrototypeMap ( watchedExpressions , inspectValue ) ) ) ;
660+ const values = await SafePromiseAll ( watchedExpressions , inspectValue ) ;
666661 const lines = ArrayPrototypeMap ( watchedExpressions , ( expr , idx ) => {
667662 const prefix = `${ leftPad ( idx , ' ' , lastIndex ) } : ${ expr } =` ;
668663 const value = inspect ( values [ idx ] ) ;
@@ -866,7 +861,7 @@ function createRepl(inspector) {
866861 location . lineNumber + 1 ) ) ;
867862 if ( ! newBreakpoints . length ) return PromiseResolve ( ) ;
868863 return PromisePrototypeThen (
869- PromiseAll ( new SafeArrayIterator ( newBreakpoints ) ) ,
864+ SafePromiseAll ( newBreakpoints ) ,
870865 ( results ) => {
871866 print ( `${ results . length } breakpoints restored.` ) ;
872867 } ) ;
@@ -902,8 +897,7 @@ function createRepl(inspector) {
902897
903898 inspector . suspendReplWhile ( ( ) =>
904899 PromisePrototypeThen (
905- PromiseAll ( new SafeArrayIterator (
906- [ formatWatchers ( true ) , selectedFrame . list ( 2 ) ] ) ) ,
900+ SafePromiseAll ( [ formatWatchers ( true ) , selectedFrame . list ( 2 ) ] ) ,
907901 ( { 0 : watcherList , 1 : context } ) => {
908902 const breakContext = watcherList ?
909903 `${ watcherList } \n${ inspect ( context ) } ` :
0 commit comments