Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3d81ea9

Browse filesBrowse files
thefourtheyeMyles Borins
authored andcommitted
lib,test: update let to const where applicable
As per the `prefer-const` eslint rule, few instances of `let` have been identified to be better with `const`. This patch updates all those instances. Refer: #3118 PR-URL: #3152 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
1 parent 80b4ba2 commit 3d81ea9
Copy full SHA for 3d81ea9

File tree

Expand file treeCollapse file tree

8 files changed

+15
-14
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

8 files changed

+15
-14
lines changed
Open diff view settings
Collapse file

‎lib/cluster.js‎

Copy file name to clipboardExpand all lines: lib/cluster.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function masterInit() {
291291
var match = execArgv[i].match(/^(--debug|--debug-(brk|port))(=\d+)?$/);
292292

293293
if (match) {
294-
let debugPort = process.debugPort + debugPortOffset;
294+
const debugPort = process.debugPort + debugPortOffset;
295295
++debugPortOffset;
296296
execArgv[i] = match[1] + '=' + debugPort;
297297
}
Collapse file

‎lib/util.js‎

Copy file name to clipboardExpand all lines: lib/util.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ function formatCollectionIterator(ctx, value, recurseTimes, visibleKeys, keys) {
517517
var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1;
518518
var vals = mirror.preview();
519519
var output = [];
520-
for (let o of vals) {
520+
for (const o of vals) {
521521
output.push(formatValue(ctx, o, nextRecurseTimes));
522522
}
523523
return output;
Collapse file

‎test/parallel/test-async-wrap-check-providers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-async-wrap-check-providers.js
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,17 @@ process.on('SIGINT', () => process.exit());
7373

7474
// Run from closed net server above.
7575
function checkTLS() {
76-
let options = {
76+
const options = {
7777
key: fs.readFileSync(common.fixturesDir + '/keys/ec-key.pem'),
7878
cert: fs.readFileSync(common.fixturesDir + '/keys/ec-cert.pem')
7979
};
80-
let server = tls.createServer(options, noop).listen(common.PORT, function() {
81-
tls.connect(common.PORT, { rejectUnauthorized: false }, function() {
82-
this.destroy();
83-
server.close();
80+
const server = tls.createServer(options, noop)
81+
.listen(common.PORT, function() {
82+
tls.connect(common.PORT, { rejectUnauthorized: false }, function() {
83+
this.destroy();
84+
server.close();
85+
});
8486
});
85-
});
8687
}
8788

8889
zlib.createGzip();
Collapse file

‎test/parallel/test-buffer-zero-fill-reset.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-zero-fill-reset.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ function testUint8Array(ui) {
1414

1515
for (let i = 0; i < 100; i++) {
1616
new Buffer(0);
17-
let ui = new Uint8Array(65);
17+
const ui = new Uint8Array(65);
1818
assert.ok(testUint8Array(ui), 'Uint8Array is not zero-filled');
1919
}
Collapse file

‎test/parallel/test-http-flush-headers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-flush-headers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ server.on('request', function(req, res) {
1010
server.close();
1111
});
1212
server.listen(common.PORT, '127.0.0.1', function() {
13-
let req = http.request({
13+
const req = http.request({
1414
method: 'GET',
1515
host: '127.0.0.1',
1616
port: common.PORT,
Collapse file

‎test/parallel/test-tls-socket-default-options.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-socket-default-options.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function testSocketOptions(socket, socketOptions) {
3333
setImmediate(runTests);
3434
});
3535
}).listen(common.PORT, function() {
36-
let c = new tls.TLSSocket(socket, socketOptions);
36+
const c = new tls.TLSSocket(socket, socketOptions);
3737
c.connect(common.PORT, function() {
3838
c.end(sent);
3939
});
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ map.set(1, 2);
135135
var mirror = Debug.MakeMirror(map.entries(), true);
136136
var vals = mirror.preview();
137137
var valsOutput = [];
138-
for (let o of vals) {
138+
for (const o of vals) {
139139
valsOutput.push(o);
140140
}
141141

Collapse file

‎test/sequential/test-child-process-fork-getconnections.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-child-process-fork-getconnections.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const net = require('net');
66
const count = 12;
77

88
if (process.argv[2] === 'child') {
9-
let sockets = [];
9+
const sockets = [];
1010

1111
process.on('message', function(m, socket) {
1212
function sendClosed(id) {
@@ -42,7 +42,7 @@ if (process.argv[2] === 'child') {
4242
});
4343

4444
const server = net.createServer();
45-
let sockets = [];
45+
const sockets = [];
4646
let sent = 0;
4747

4848
server.on('connection', function(socket) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.