@@ -331,6 +331,7 @@ function createRepl(inspector) {
331331 } )
332332 . join ( '\n' ) ;
333333 }
334+
334335 function listScripts ( displayNatives = false ) {
335336 print ( formatScripts ( displayNatives ) ) ;
336337 }
@@ -380,9 +381,9 @@ function createRepl(inspector) {
380381 const i = start + offset ;
381382 const isCurrent = i === ( lineNumber + 1 ) ;
382383
383- const markedLine = isCurrent
384- ? markSourceColumn ( lineText , columnNumber , options . colors )
385- : lineText ;
384+ const markedLine = isCurrent ?
385+ markSourceColumn ( lineText , columnNumber , options . colors ) :
386+ lineText ;
386387
387388 let isBreakpoint = false ;
388389 knownBreakpoints . forEach ( ( { location } ) => {
@@ -466,7 +467,7 @@ function createRepl(inspector) {
466467
467468 function prepareControlCode ( input ) {
468469 if ( input === '\n' ) return lastCommand ;
469- // exec process.title => exec("process.title");
470+ // Add parentheses: exec process.title => exec("process.title");
470471 const match = input . match ( / ^ \s * e x e c \s + ( [ ^ \n ] * ) / ) ;
471472 if ( match ) {
472473 lastCommand = `exec(${ JSON . stringify ( match [ 1 ] ) } )` ;
@@ -656,13 +657,13 @@ function createRepl(inspector) {
656657 // setBreakpoint('fn()'): Break when a function is called
657658 if ( script . endsWith ( '()' ) ) {
658659 const debugExpr = `debug(${ script . slice ( 0 , - 2 ) } )` ;
659- const debugCall = selectedFrame
660- ? Debugger . evaluateOnCallFrame ( {
660+ const debugCall = selectedFrame ?
661+ Debugger . evaluateOnCallFrame ( {
661662 callFrameId : selectedFrame . callFrameId ,
662663 expression : debugExpr ,
663664 includeCommandLineAPI : true ,
664- } )
665- : Runtime . evaluate ( {
665+ } ) :
666+ Runtime . evaluate ( {
666667 expression : debugExpr ,
667668 includeCommandLineAPI : true ,
668669 } ) ;
@@ -785,7 +786,7 @@ function createRepl(inspector) {
785786
786787 inspector . suspendReplWhile ( ( ) =>
787788 Promise . all ( [ formatWatchers ( true ) , selectedFrame . list ( 2 ) ] )
788- . then ( ( [ watcherList , context ] ) => {
789+ . then ( ( { 0 : watcherList , 1 : context } ) => {
789790 if ( watcherList ) {
790791 return `${ watcherList } \n${ inspect ( context ) } ` ;
791792 }
@@ -807,17 +808,15 @@ function createRepl(inspector) {
807808 Debugger . on ( 'scriptParsed' , ( script ) => {
808809 const { scriptId, url } = script ;
809810 if ( url ) {
810- knownScripts [ scriptId ] = Object . assign ( {
811- isNative : isNativeUrl ( url ) ,
812- } , script ) ;
811+ knownScripts [ scriptId ] = { isNative : isNativeUrl ( url ) , ...script } ;
813812 }
814813 } ) ;
815814
816815 Profiler . on ( 'consoleProfileFinished' , ( { profile } ) => {
817816 Profile . createAndRegister ( { profile } ) ;
818817 print ( [
819818 'Captured new CPU profile.' ,
820- `Access it with profiles[${ profiles . length - 1 } ]`
819+ `Access it with profiles[${ profiles . length - 1 } ]` ,
821820 ] . join ( '\n' ) ) ;
822821 } ) ;
823822
@@ -909,22 +908,26 @@ function createRepl(inspector) {
909908 print ( `Heap snapshot: ${ done } /${ total } ` , false ) ;
910909 }
911910 }
911+
912912 function onChunk ( { chunk } ) {
913913 sizeWritten += chunk . length ;
914914 writer . write ( chunk ) ;
915915 print ( `Writing snapshot: ${ sizeWritten } ` , false ) ;
916916 }
917+
917918 function onResolve ( ) {
918919 writer . end ( ( ) => {
919920 teardown ( ) ;
920921 print ( `Wrote snapshot: ${ absoluteFile } ` ) ;
921922 resolve ( ) ;
922923 } ) ;
923924 }
925+
924926 function onReject ( error ) {
925927 teardown ( ) ;
926928 reject ( error ) ;
927929 }
930+
928931 function teardown ( ) {
929932 HeapProfiler . removeListener (
930933 'reportHeapSnapshotProgress' , onProgress ) ;
@@ -1049,7 +1052,7 @@ function createRepl(inspector) {
10491052 . then ( ( ) => Debugger . setBlackboxPatterns ( { patterns : [ ] } ) )
10501053 . then ( ( ) => Debugger . setPauseOnExceptions ( { state : pauseOnExceptionState } ) )
10511054 . then ( ( ) => restoreBreakpoints ( ) )
1052- . then ( ( ) => Runtime . runIfWaitingForDebugger ( ) )
1055+ . then ( ( ) => Runtime . runIfWaitingForDebugger ( ) ) ;
10531056 }
10541057
10551058 return async function startRepl ( ) {
0 commit comments