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 <[email protected]>
1 parent 066d5e7 commit 607f545

File tree

109 files changed

+943
-896
lines changed

Some content is hidden

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

109 files changed

+943
-896
lines changed

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
return undefined;
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-
/break in .*[\\\/]mod\.js:23/,
24-
/21/, /22/, /23/, /24/, /25/
23+
/break in .*[\\\/]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
var linesWithBreakpoint = [
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-
var http = 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+
const http = require('http');
10+
const weak = require('weak');
11+
const common = require('../common');
12+
const assert = require('assert');
13+
const PORT = common.PORT;
14+
const todo = 500;
15+
let done = 0;
16+
let count = 0;
17+
let countGC = 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-
var http = 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+
const http = require('http');
12+
const weak = require('weak');
13+
const common = require('../common');
14+
const assert = require('assert');
15+
const PORT = common.PORT;
16+
const todo = 500;
17+
let done = 0;
18+
let count = 0;
19+
let countGC = 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-
var http = 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+
const http = require('http');
14+
const weak = require('weak');
15+
const common = require('../common');
16+
const assert = require('assert');
17+
const PORT = common.PORT;
18+
const todo = 550;
19+
let done = 0;
20+
let count = 0;
21+
let countGC = 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-
var http = 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+
const http = require('http');
10+
const weak = require('weak');
11+
const common = require('../common');
12+
const assert = require('assert');
13+
const PORT = common.PORT;
14+
const todo = 500;
15+
let done = 0;
16+
let count = 0;
17+
let countGC = 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-
var net = 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+
const net = require('net');
21+
const weak = require('weak');
22+
const common = require('../common');
23+
const assert = require('assert');
24+
const PORT = common.PORT;
25+
const todo = 500;
26+
let done = 0;
27+
let count = 0;
28+
let countGC = 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-
var common = 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-
new Buffer('First message to send'),
13-
new Buffer('Second message to send'),
14-
new Buffer('Third message to send'),
15-
new Buffer('Fourth message to send')
16-
];
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const dgram = require('dgram');
5+
const util = require('util');
6+
const networkInterfaces = require('os').networkInterfaces();
7+
const Buffer = require('buffer').Buffer;
8+
const fork = require('child_process').fork;
9+
const LOCAL_BROADCAST_HOST = '255.255.255.255';
10+
const TIMEOUT = common.platformTimeout(5000);
11+
const messages = [
12+
new Buffer('First message to send'),
13+
new Buffer('Second message to send'),
14+
new Buffer('Third message to send'),
15+
new Buffer('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-
var workers = {},
38-
listeners = 3,
39-
listening = 0,
40-
dead = 0,
41-
i = 0,
42-
done = 0,
43-
timer = null;
37+
const workers = {};
38+
const listeners = 3;
39+
let listening = 0;
40+
let dead = 0;
41+
let i = 0;
42+
let done = 0;
43+
let timer = 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) throw err;
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) throw err;
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
function killChildren(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) throw err;
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) throw err;
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)