@@ -4,12 +4,12 @@ const assert = require('assert');
4
4
const spawn = require ( 'child_process' ) . spawn ;
5
5
6
6
process . env . NODE_DEBUGGER_TIMEOUT = 2000 ;
7
- var port = common . PORT ;
7
+ const port = common . PORT ;
8
8
9
- var child ;
10
- var buffer = '' ;
11
- var expected = [ ] ;
12
- var quit ;
9
+ let child ;
10
+ let buffer = '' ;
11
+ const expected = [ ] ;
12
+ let quit ;
13
13
14
14
function startDebugger ( scriptToDebug ) {
15
15
scriptToDebug = process . env . NODE_DEBUGGER_TEST_SCRIPT ||
@@ -34,23 +34,23 @@ function startDebugger(scriptToDebug) {
34
34
console . log ( line ) ;
35
35
assert . ok ( expected . length > 0 , 'Got unexpected line: ' + line ) ;
36
36
37
- var expectedLine = expected [ 0 ] . lines . shift ( ) ;
37
+ const expectedLine = expected [ 0 ] . lines . shift ( ) ;
38
38
assert . ok ( line . match ( expectedLine ) !== null , line + ' != ' + expectedLine ) ;
39
39
40
40
if ( expected [ 0 ] . lines . length === 0 ) {
41
- var callback = expected [ 0 ] . callback ;
41
+ const callback = expected [ 0 ] . callback ;
42
42
expected . shift ( ) ;
43
43
callback && callback ( ) ;
44
44
}
45
45
} ) ;
46
46
47
- var childClosed = false ;
47
+ let childClosed = false ;
48
48
child . on ( 'close' , function ( code ) {
49
49
assert ( ! code ) ;
50
50
childClosed = true ;
51
51
} ) ;
52
52
53
- var quitCalled = false ;
53
+ let quitCalled = false ;
54
54
quit = function ( ) {
55
55
if ( quitCalled || childClosed ) return ;
56
56
quitCalled = true ;
@@ -60,7 +60,7 @@ function startDebugger(scriptToDebug) {
60
60
61
61
setTimeout ( function ( ) {
62
62
console . error ( 'dying badly buffer=%j' , buffer ) ;
63
- var err = 'Timeout' ;
63
+ let err = 'Timeout' ;
64
64
if ( expected . length > 0 && expected [ 0 ] . lines ) {
65
65
err = err + '. Expected: ' + expected [ 0 ] . lines . shift ( ) ;
66
66
}
@@ -95,7 +95,7 @@ function addTest(input, output) {
95
95
child . stdin . write ( expected [ 0 ] . input + '\n' ) ;
96
96
97
97
if ( ! expected [ 0 ] . lines ) {
98
- var callback = expected [ 0 ] . callback ;
98
+ const callback = expected [ 0 ] . callback ;
99
99
expected . shift ( ) ;
100
100
101
101
callback && callback ( ) ;
@@ -107,17 +107,17 @@ function addTest(input, output) {
107
107
expected . push ( { input : input , lines : output , callback : next } ) ;
108
108
}
109
109
110
- var handshakeLines = [
110
+ const handshakeLines = [
111
111
/ l i s t e n i n g o n / ,
112
112
/ c o n n e c t i n g .* o k /
113
113
] ;
114
114
115
- var initialBreakLines = [
115
+ const initialBreakLines = [
116
116
/ b r e a k i n .* : 1 / ,
117
117
/ 1 / , / 2 / , / 3 /
118
118
] ;
119
119
120
- var initialLines = handshakeLines . concat ( initialBreakLines ) ;
120
+ const initialLines = handshakeLines . concat ( initialBreakLines ) ;
121
121
122
122
// Process initial lines
123
123
addTest ( null , initialLines ) ;
0 commit comments