Skip to content

Commit 607f545

Browse files
targosMyles Borins
authored andcommitted
test: fix style issues after eslint update
Replace var keyword with const or let. PR-URL: #2286 Reviewed-By: Roman Reiss <me@silverwind.io>
1 parent 066d5e7 commit 607f545

109 files changed

Lines changed: 943 additions & 896 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎test/common.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ exports.getServiceName = function getServiceName(port, protocol) {
437437
if(matches&&matches.length>1){
438438
serviceName=matches[1];
439439
}
440-
}catch(e){
440+
}catch(e){
441441
console.error('Cannot read file: ',etcServicesFileName);
442442
returnundefined;
443443
}

‎test/debugger/test-debugger-repl-break-in-module.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ repl.addTest('sb(")^$*+?}{|][(.js\\\\", 1)', [
2020

2121
// continue - the breakpoint should be triggered
2222
repl.addTest('c',[
23-
/breakin.*[\\\/]mod\.js:23/,
24-
/21/,/22/,/23/,/24/,/25/
23+
/breakin.*[\\\/]mod\.js:23/,
24+
/21/,/22/,/23/,/24/,/25/
2525
]);
2626

2727
// -- RESTORE BREAKPOINT ON RESTART --

‎test/debugger/test-debugger-repl-restart.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var repl = require('./helper-debugger-repl.js');
44

55
repl.startDebugger('breakpoints.js');
66
varlinesWithBreakpoint=[
7-
/1/,/2/,/3/,/4/,/5/,/\*6/
7+
/1/,/2/,/3/,/4/,/5/,/\*6/
88
];
99
// We slice here, because addTest will change the given array.
1010
repl.addTest('sb(6)',linesWithBreakpoint.slice());

‎test/gc/test-http-client-connaborted.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ function serverHandler(req, res) {
66
res.connection.destroy();
77
}
88

9-
varhttp=require('http'),
10-
weak=require('weak'),
11-
done=0,
12-
count=0,
13-
countGC=0,
14-
todo=500,
15-
common=require('../common'),
16-
assert=require('assert'),
17-
PORT=common.PORT;
9+
consthttp=require('http');
10+
constweak=require('weak');
11+
constcommon=require('../common');
12+
constassert=require('assert');
13+
constPORT=common.PORT;
14+
consttodo=500;
15+
letdone=0;
16+
letcount=0;
17+
letcountGC=0;
1818

1919
console.log('We should do '+todo+' requests');
2020

‎test/gc/test-http-client-onerror.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ function serverHandler(req, res) {
88
res.end('Hello World\n');
99
}
1010

11-
varhttp=require('http'),
12-
weak=require('weak'),
13-
done=0,
14-
count=0,
15-
countGC=0,
16-
todo=500,
17-
common=require('../common'),
18-
assert=require('assert'),
19-
PORT=common.PORT;
11+
consthttp=require('http');
12+
constweak=require('weak');
13+
constcommon=require('../common');
14+
constassert=require('assert');
15+
constPORT=common.PORT;
16+
consttodo=500;
17+
letdone=0;
18+
letcount=0;
19+
letcountGC=0;
2020

2121
console.log('We should do '+todo+' requests');
2222

‎test/gc/test-http-client-timeout.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ function serverHandler(req, res) {
1010
},100);
1111
}
1212

13-
varhttp=require('http'),
14-
weak=require('weak'),
15-
done=0,
16-
count=0,
17-
countGC=0,
18-
todo=550,
19-
common=require('../common'),
20-
assert=require('assert'),
21-
PORT=common.PORT;
13+
consthttp=require('http');
14+
constweak=require('weak');
15+
constcommon=require('../common');
16+
constassert=require('assert');
17+
constPORT=common.PORT;
18+
consttodo=550;
19+
letdone=0;
20+
letcount=0;
21+
letcountGC=0;
2222

2323
console.log('We should do '+todo+' requests');
2424

‎test/gc/test-http-client.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ function serverHandler(req, res) {
66
res.end('Hello World\n');
77
}
88

9-
varhttp=require('http'),
10-
weak=require('weak'),
11-
done=0,
12-
count=0,
13-
countGC=0,
14-
todo=500,
15-
common=require('../common'),
16-
assert=require('assert'),
17-
PORT=common.PORT;
9+
consthttp=require('http');
10+
constweak=require('weak');
11+
constcommon=require('../common');
12+
constassert=require('assert');
13+
constPORT=common.PORT;
14+
consttodo=500;
15+
letdone=0;
16+
letcount=0;
17+
letcountGC=0;
1818

1919
console.log('We should do '+todo+' requests');
2020

‎test/gc/test-net-timeout.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ function serverHandler(sock) {
1717
},100);
1818
}
1919

20-
varnet=require('net'),
21-
weak=require('weak'),
22-
done=0,
23-
count=0,
24-
countGC=0,
25-
todo=500,
26-
common=require('../common'),
27-
assert=require('assert'),
28-
PORT=common.PORT;
20+
constnet=require('net');
21+
constweak=require('weak');
22+
constcommon=require('../common');
23+
constassert=require('assert');
24+
constPORT=common.PORT;
25+
consttodo=500;
26+
letdone=0;
27+
letcount=0;
28+
letcountGC=0;
2929

3030
console.log('We should do '+todo+' requests');
3131

‎test/internet/test-dgram-broadcast-multi-process.js‎

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict';
2-
varcommon=require('../common'),
3-
assert=require('assert'),
4-
dgram=require('dgram'),
5-
util=require('util'),
6-
networkInterfaces=require('os').networkInterfaces(),
7-
Buffer=require('buffer').Buffer,
8-
fork=require('child_process').fork,
9-
LOCAL_BROADCAST_HOST='255.255.255.255',
10-
TIMEOUT=common.platformTimeout(5000),
11-
messages=[
12-
newBuffer('First message to send'),
13-
newBuffer('Second message to send'),
14-
newBuffer('Third message to send'),
15-
newBuffer('Fourth message to send')
16-
];
2+
constcommon=require('../common');
3+
constassert=require('assert');
4+
constdgram=require('dgram');
5+
constutil=require('util');
6+
constnetworkInterfaces=require('os').networkInterfaces();
7+
constBuffer=require('buffer').Buffer;
8+
constfork=require('child_process').fork;
9+
constLOCAL_BROADCAST_HOST='255.255.255.255';
10+
constTIMEOUT=common.platformTimeout(5000);
11+
constmessages=[
12+
newBuffer('First message to send'),
13+
newBuffer('Second message to send'),
14+
newBuffer('Third message to send'),
15+
newBuffer('Fourth message to send')
16+
];
1717

1818
if(common.inFreeBSDJail){
1919
console.log('1..0 # Skipped: in a FreeBSD jail');
@@ -34,13 +34,13 @@ get_bindAddress: for (var name in networkInterfaces) {
3434
assert.ok(bindAddress);
3535

3636
if(process.argv[2]!=='child'){
37-
varworkers={},
38-
listeners=3,
39-
listening=0,
40-
dead=0,
41-
i=0,
42-
done=0,
43-
timer=null;
37+
constworkers={};
38+
constlisteners=3;
39+
letlistening=0;
40+
letdead=0;
41+
leti=0;
42+
letdone=0;
43+
lettimer=null;
4444

4545
//exit the test if it doesn't succeed within TIMEOUT
4646
timer=setTimeout(function(){
@@ -166,15 +166,21 @@ if (process.argv[2] !== 'child') {
166166
return;
167167
}
168168

169-
sendSocket.send(buf,0,buf.length,
170-
common.PORT,LOCAL_BROADCAST_HOST,function(err){
171-
if(err)throwerr;
172-
console.error('[PARENT] sent %s to %s:%s',
173-
util.inspect(buf.toString()),
174-
LOCAL_BROADCAST_HOST,common.PORT);
175-
176-
process.nextTick(sendSocket.sendNext);
177-
});
169+
sendSocket.send(
170+
buf,
171+
0,
172+
buf.length,
173+
common.PORT,
174+
LOCAL_BROADCAST_HOST,
175+
function(err){
176+
if(err)throwerr;
177+
console.error('[PARENT] sent %s to %s:%s',
178+
util.inspect(buf.toString()),
179+
LOCAL_BROADCAST_HOST,common.PORT);
180+
181+
process.nextTick(sendSocket.sendNext);
182+
}
183+
);
178184
};
179185

180186
functionkillChildren(children){

‎test/internet/test-dgram-multicast-multi-process.js‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,20 @@ if (process.argv[2] !== 'child') {
157157
return;
158158
}
159159

160-
sendSocket.send(buf,0,buf.length,
161-
common.PORT,LOCAL_BROADCAST_HOST,function(err){
162-
if(err)throwerr;
163-
console.error('[PARENT] sent "%s" to %s:%s',
164-
buf.toString(),
165-
LOCAL_BROADCAST_HOST,common.PORT);
166-
process.nextTick(sendSocket.sendNext);
167-
});
160+
sendSocket.send(
161+
buf,
162+
0,
163+
buf.length,
164+
common.PORT,
165+
LOCAL_BROADCAST_HOST,
166+
function(err){
167+
if(err)throwerr;
168+
console.error('[PARENT] sent "%s" to %s:%s',
169+
buf.toString(),
170+
LOCAL_BROADCAST_HOST,common.PORT);
171+
process.nextTick(sendSocket.sendNext);
172+
}
173+
);
168174
};
169175
}
170176

0 commit comments

Comments
 (0)