diff --git a/test/parallel/test-debug-brk.js b/test/parallel/test-debug-brk.js index 49b19898e0..b833421f93 100644 --- a/test/parallel/test-debug-brk.js +++ b/test/parallel/test-debug-brk.js @@ -4,6 +4,6 @@ const common = require('../common'); const assert = require('assert'); const spawnSync = require('child_process').spawnSync; -const args = [`--debug-brk=${common.PORT}`, `-e`, `0`]; +const args = [`--debug-brk=${common.PORT}`, '-e', '0']; const proc = spawnSync(process.execPath, args, {encoding: 'utf8'}); assert(/Debugger listening on/.test(proc.stderr)); diff --git a/test/parallel/test-debug-no-context.js b/test/parallel/test-debug-no-context.js index 11a9aa1715..649a7b9b06 100644 --- a/test/parallel/test-debug-no-context.js +++ b/test/parallel/test-debug-no-context.js @@ -4,7 +4,7 @@ const common = require('../common'); const assert = require('assert'); const spawn = require('child_process').spawn; -const args = [`--debug`, `--debug-port=${common.PORT}`, `--interactive`]; +const args = ['--debug', `--debug-port=${common.PORT}`, '--interactive']; const proc = spawn(process.execPath, args, { stdio: 'pipe' }); proc.stdin.write(` util.inspect(Promise.resolve(42)); diff --git a/test/parallel/test-dgram-udp4.js b/test/parallel/test-dgram-udp4.js index e845c5d845..b36034f75d 100644 --- a/test/parallel/test-dgram-udp4.js +++ b/test/parallel/test-dgram-udp4.js @@ -4,10 +4,10 @@ const assert = require('assert'); const dgram = require('dgram'); const server_port = common.PORT; const message_to_send = 'A message to send'; -let server, client; +let client; let timer; -server = dgram.createSocket('udp4'); +const server = dgram.createSocket('udp4'); server.on('message', function(msg, rinfo) { console.log('server got: ' + msg + ' from ' + rinfo.address + ':' + rinfo.port); diff --git a/test/parallel/test-file-write-stream3.js b/test/parallel/test-file-write-stream3.js index 07afeab483..72f869ecf7 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -126,7 +126,6 @@ function run_test_3() { var file, options; const data = '\u2026\u2026'; // 3 bytes * 2 = 6 bytes in UTF-8 - let fileData; options = { start: 10, flags: 'r+' }; @@ -144,7 +143,7 @@ function run_test_3() { console.log(' (debug: start ', file.start); console.log(' (debug: pos ', file.pos); assert.strictEqual(file.bytesWritten, data.length * 3); - fileData = fs.readFileSync(filepath, 'utf8'); + const fileData = fs.readFileSync(filepath, 'utf8'); console.log(' (debug: file data ', fileData); console.log(' (debug: expected ', fileDataExpected_3); assert.equal(fileData, fileDataExpected_3); diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index b18afac12d..dcc28ce4d9 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -90,7 +90,7 @@ function test_simple_relative_symlink(callback) { [ [entry, '../' + common.tmpDirName + '/cycles/root.js'] ].forEach(function(t) { - try {fs.unlinkSync(t[0]);}catch (e) {} + try {fs.unlinkSync(t[0]);} catch (e) {} console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file'); fs.symlinkSync(t[1], t[0], 'file'); unlink.push(t[0]); diff --git a/test/parallel/test-url.js b/test/parallel/test-url.js index 95bde7b861..9aa2682cbc 100644 --- a/test/parallel/test-url.js +++ b/test/parallel/test-url.js @@ -259,20 +259,19 @@ var parseTests = { path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' }, - 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': - { - href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + - '&hl=en&src=api&x=2&y=2&z=3&s=', - protocol: 'http:', - slashes: true, - host: 'mt0.google.com', - auth: 'user:pass', - hostname: 'mt0.google.com', - search: '???&hl=en&src=api&x=2&y=2&z=3&s=', - query: '??&hl=en&src=api&x=2&y=2&z=3&s=', - pathname: '/vt/lyrs=m@114', - path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' - }, + 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': { + href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + + '&hl=en&src=api&x=2&y=2&z=3&s=', + protocol: 'http:', + slashes: true, + host: 'mt0.google.com', + auth: 'user:pass', + hostname: 'mt0.google.com', + search: '???&hl=en&src=api&x=2&y=2&z=3&s=', + query: '??&hl=en&src=api&x=2&y=2&z=3&s=', + pathname: '/vt/lyrs=m@114', + path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, 'file:///etc/passwd': { href: 'file:///etc/passwd', diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index f7bb9f5eea..8928ef6c74 100644 --- a/test/sequential/test-child-process-fork-getconnections.js +++ b/test/sequential/test-child-process-fork-getconnections.js @@ -56,9 +56,9 @@ if (process.argv[2] === 'child') { let disconnected = 0; server.on('listening', function() { - let j = count, client; + let j = count; while (j--) { - client = net.connect(common.PORT, '127.0.0.1'); + const client = net.connect(common.PORT, '127.0.0.1'); client.on('close', function() { disconnected += 1; }); diff --git a/tools/doc/addon-verify.js b/tools/doc/addon-verify.js index 6aafb8f6fd..5ff12d342c 100644 --- a/tools/doc/addon-verify.js +++ b/tools/doc/addon-verify.js @@ -12,7 +12,6 @@ const contents = fs.readFileSync(doc).toString(); const tokens = marked.lexer(contents, {}); let files = null; -let blockName; let id = 0; // Just to make sure that all examples will be processed @@ -28,7 +27,7 @@ oldDirs = oldDirs.filter(function(dir) { for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (token.type === 'heading' && token.text) { - blockName = token.text; + const blockName = token.text; if (files && Object.keys(files).length !== 0) { verifyFiles(files, blockName,