@@ -30,15 +30,15 @@ const runAsStandalone = typeof __dirname !== 'undefined';
3030const [ InspectClient , createRepl ] =
3131 runAsStandalone ?
3232 // This copy of node-inspect is on-disk, relative paths make sense.
33- [
34- require ( './internal/inspect_client' ) ,
35- require ( './internal/inspect_repl' )
36- ] :
33+ [
34+ require ( './internal/inspect_client' ) ,
35+ require ( './internal/inspect_repl' )
36+ ] :
3737 // This copy of node-inspect is built into the node executable.
38- [
39- require ( 'node-inspect/lib/internal/inspect_client' ) ,
40- require ( 'node-inspect/lib/internal/inspect_repl' )
41- ] ;
38+ [
39+ require ( 'node-inspect/lib/internal/inspect_client' ) ,
40+ require ( 'node-inspect/lib/internal/inspect_repl' )
41+ ] ;
4242
4343const debuglog = util . debuglog ( 'inspect' ) ;
4444
@@ -49,8 +49,8 @@ class StartupError extends Error {
4949 }
5050}
5151
52- function portIsFree ( host , port , timeout = 2000 ) {
53- if ( port === 0 ) return Promise . resolve ( ) ; // Binding to a random port.
52+ function portIsFree ( host , port , timeout = 9999 ) {
53+ if ( port === 0 ) return Promise . resolve ( ) ; // Binding to a random port.
5454
5555 const retryDelay = 150 ;
5656 let didTimeOut = false ;
@@ -96,9 +96,9 @@ function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
9696 return new Promise ( ( resolve ) => {
9797 const needDebugBrk = process . version . match ( / ^ v ( 6 | 7 ) \. / ) ;
9898 const args = ( needDebugBrk ?
99- [ '--inspect' , `--debug-brk=${ inspectPort } ` ] :
100- [ `--inspect-brk=${ inspectPort } ` ] )
101- . concat ( [ script ] , scriptArgs ) ;
99+ [ '--inspect' , `--debug-brk=${ inspectPort } ` ] :
100+ [ `--inspect-brk=${ inspectPort } ` ] )
101+ . concat ( [ script ] , scriptArgs ) ;
102102 const child = spawn ( process . execPath , args ) ;
103103 child . stdout . setEncoding ( 'utf8' ) ;
104104 child . stderr . setEncoding ( 'utf8' ) ;
@@ -154,11 +154,11 @@ class NodeInspector {
154154
155155 if ( options . script ) {
156156 this . _runScript = runScript . bind ( null ,
157- options . script ,
158- options . scriptArgs ,
159- options . host ,
160- options . port ,
161- this . childPrint . bind ( this ) ) ;
157+ options . script ,
158+ options . scriptArgs ,
159+ options . host ,
160+ options . port ,
161+ this . childPrint . bind ( this ) ) ;
162162 } else {
163163 this . _runScript =
164164 ( ) => Promise . resolve ( [ null , options . port , options . host ] ) ;
@@ -333,8 +333,8 @@ function parseArgv([target, ...args]) {
333333}
334334
335335function startInspect ( argv = process . argv . slice ( 2 ) ,
336- stdin = process . stdin ,
337- stdout = process . stdout ) {
336+ stdin = process . stdin ,
337+ stdout = process . stdout ) {
338338 /* eslint-disable no-console */
339339 if ( argv . length < 1 ) {
340340 const invokedAs = runAsStandalone ?
0 commit comments