@@ -30,15 +30,15 @@ const runAsStandalone = typeof __dirname !== 'undefined';
30
30
const [ InspectClient , createRepl ] =
31
31
runAsStandalone ?
32
32
// 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
+ ] :
37
37
// 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
+ ] ;
42
42
43
43
const debuglog = util . debuglog ( 'inspect' ) ;
44
44
@@ -49,8 +49,8 @@ class StartupError extends Error {
49
49
}
50
50
}
51
51
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.
54
54
55
55
const retryDelay = 150 ;
56
56
let didTimeOut = false ;
@@ -96,9 +96,9 @@ function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
96
96
return new Promise ( ( resolve ) => {
97
97
const needDebugBrk = process . version . match ( / ^ v ( 6 | 7 ) \. / ) ;
98
98
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 ) ;
102
102
const child = spawn ( process . execPath , args ) ;
103
103
child . stdout . setEncoding ( 'utf8' ) ;
104
104
child . stderr . setEncoding ( 'utf8' ) ;
@@ -154,11 +154,11 @@ class NodeInspector {
154
154
155
155
if ( options . script ) {
156
156
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 ) ) ;
162
162
} else {
163
163
this . _runScript =
164
164
( ) => Promise . resolve ( [ null , options . port , options . host ] ) ;
@@ -333,8 +333,8 @@ function parseArgv([target, ...args]) {
333
333
}
334
334
335
335
function startInspect ( argv = process . argv . slice ( 2 ) ,
336
- stdin = process . stdin ,
337
- stdout = process . stdout ) {
336
+ stdin = process . stdin ,
337
+ stdout = process . stdout ) {
338
338
/* eslint-disable no-console */
339
339
if ( argv . length < 1 ) {
340
340
const invokedAs = runAsStandalone ?
0 commit comments