This repository was archived by the owner on Feb 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11language : node_js
22node_js :
33 - ' 6'
4- before_install :
5- - npm install -g npm@latest-2
64before_deploy :
75 - git config --global user.email "jan.krems@gmail.com"
86 - git config --global user.name "Jan Krems"
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ function aliasProperties(target, mapping) {
106106 } ) ;
107107}
108108
109- function startRepl ( inspector ) {
109+ function createRepl ( inspector ) {
110110 const { Debugger } = inspector ;
111111
112112 let repl ; // eslint-disable-line prefer-const
@@ -349,18 +349,19 @@ function startRepl(inspector) {
349349 aliasProperties ( context , SHORTCUTS ) ;
350350 }
351351
352- const replOptions = {
353- prompt : 'debug> ' ,
354- input : inspector . stdin ,
355- output : inspector . stdout ,
356- eval : controlEval ,
357- useGlobal : false ,
358- ignoreUndefined : true ,
352+ return function startRepl ( ) {
353+ const replOptions = {
354+ prompt : 'debug> ' ,
355+ input : inspector . stdin ,
356+ output : inspector . stdout ,
357+ eval : controlEval ,
358+ useGlobal : false ,
359+ ignoreUndefined : true ,
360+ } ;
361+ repl = Repl . start ( replOptions ) ; // eslint-disable-line prefer-const
362+ initializeContext ( repl . context ) ;
363+ repl . on ( 'reset' , initializeContext ) ;
364+ return repl ;
359365 } ;
360- repl = Repl . start ( replOptions ) ; // eslint-disable-line prefer-const
361- initializeContext ( repl . context ) ;
362- repl . on ( 'reset' , initializeContext ) ;
363-
364- return repl ;
365366}
366- module . exports = startRepl ;
367+ module . exports = createRepl ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const util = require('util');
2727const debuglog = util . debuglog ( 'inspect' ) ;
2828
2929const ProtocolClient = require ( './internal/inspect-protocol' ) ;
30- const startRepl = require ( './internal/inspect-repl' ) ;
30+ const createRepl = require ( './internal/inspect-repl' ) ;
3131
3232exports . port = 9229 ;
3333
@@ -105,25 +105,24 @@ class NodeInspector {
105105 }
106106 } ;
107107 this . client . on ( 'debugEvent' , this . handleDebugEvent ) ;
108+ const startRepl = createRepl ( this ) ;
108109
109110 // Handle all possible exits
110111 process . on ( 'exit' , ( ) => this . killChild ( ) ) ;
111112 process . once ( 'SIGTERM' , process . exit . bind ( process , 0 ) ) ;
112113 process . once ( 'SIGHUP' , process . exit . bind ( process , 0 ) ) ;
113114
114115 this . run ( )
115- . then ( ( ) => this . _setupRepl ( ) )
116+ . then ( ( ) => {
117+ this . repl = startRepl ( ) ;
118+ this . repl . on ( 'exit' , ( ) => {
119+ process . exit ( 0 ) ;
120+ } ) ;
121+ this . paused = false ;
122+ } )
116123 . then ( null , throwUnexpectedError ) ;
117124 }
118125
119- _setupRepl ( ) {
120- this . repl = startRepl ( this ) ;
121- this . repl . on ( 'exit' , ( ) => {
122- process . exit ( 0 ) ;
123- } ) ;
124- this . paused = false ;
125- }
126-
127126 suspendReplWhile ( fn ) {
128127 this . repl . rli . pause ( ) ;
129128 this . stdin . pause ( ) ;
You can’t perform that action at this time.
0 commit comments