diff options
author | cjihrig <cjihrig@gmail.com> | 2016-12-30 18:38:06 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2017-01-02 18:28:18 -0500 |
commit | ff1efa60878d8353e1b8e36684a786bdf57963fb (patch) | |
tree | 31399a1732ff2b91374fdcaaf2d5d0976b6a00a7 | |
parent | 1605a2e02ae6887e57292543489c76eef5c545d0 (diff) | |
download | node-new-ff1efa60878d8353e1b8e36684a786bdf57963fb.tar.gz |
test: use const for all require() calls
PR-URL: https://github.com/nodejs/node/pull/10550
Reviewed-By: Rich Trott <rtrott@gmail.com>
605 files changed, 1573 insertions, 1552 deletions
diff --git a/test/addons/async-hello-world/test.js b/test/addons/async-hello-world/test.js index 7c27382c1c..a6aa8aa20f 100644 --- a/test/addons/async-hello-world/test.js +++ b/test/addons/async-hello-world/test.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../../common'); -var assert = require('assert'); +const assert = require('assert'); const binding = require(`./build/${common.buildType}/binding`); binding(5, common.mustCall(function(err, val) { diff --git a/test/addons/hello-world-function-export/test.js b/test/addons/hello-world-function-export/test.js index 74ea66c79c..173cf5428e 100644 --- a/test/addons/hello-world-function-export/test.js +++ b/test/addons/hello-world-function-export/test.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../../common'); -var assert = require('assert'); +const assert = require('assert'); const binding = require(`./build/${common.buildType}/binding`); assert.strictEqual(binding(), 'world'); console.log('binding.hello() =', binding()); diff --git a/test/addons/hello-world/test.js b/test/addons/hello-world/test.js index 32066388ef..b0148e9d9e 100644 --- a/test/addons/hello-world/test.js +++ b/test/addons/hello-world/test.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../../common'); -var assert = require('assert'); +const assert = require('assert'); const binding = require(`./build/${common.buildType}/binding`); assert.strictEqual(binding.hello(), 'world'); console.log('binding.hello() =', binding.hello()); diff --git a/test/addons/load-long-path/test.js b/test/addons/load-long-path/test.js index b17942b45a..6e540fea55 100644 --- a/test/addons/load-long-path/test.js +++ b/test/addons/load-long-path/test.js @@ -32,6 +32,6 @@ var contents = fs.readFileSync(addonPath); fs.writeFileSync(addonDestinationPath, contents); // Attempt to load at long path destination -var addon = require(addonDestinationPath); +const addon = require(addonDestinationPath); assert.notEqual(addon, null); assert.strictEqual(addon.hello(), 'world'); diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js index 5591b4f2b3..1f30f0f9be 100644 --- a/test/addons/repl-domain-abort/test.js +++ b/test/addons/repl-domain-abort/test.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../../common'); -var assert = require('assert'); -var repl = require('repl'); -var stream = require('stream'); -var path = require('path'); +const common = require('../../common'); +const assert = require('assert'); +const repl = require('repl'); +const stream = require('stream'); +const path = require('path'); var buildType = process.config.target_defaults.default_configuration; var buildPath = path.join(__dirname, 'build', buildType, 'binding'); // On Windows, escape backslashes in the path before passing it to REPL. diff --git a/test/debugger/helper-debugger-repl.js b/test/debugger/helper-debugger-repl.js index 602ab1c05e..d6c3e5ca9e 100644 --- a/test/debugger/helper-debugger-repl.js +++ b/test/debugger/helper-debugger-repl.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const assert = require('assert'); +const spawn = require('child_process').spawn; process.env.NODE_DEBUGGER_TIMEOUT = 2000; var port = common.PORT; diff --git a/test/debugger/test-debugger-repl-break-in-module.js b/test/debugger/test-debugger-repl-break-in-module.js index 91782ae6e3..2e7b9a58aa 100644 --- a/test/debugger/test-debugger-repl-break-in-module.js +++ b/test/debugger/test-debugger-repl-break-in-module.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var repl = require('./helper-debugger-repl.js'); +const repl = require('./helper-debugger-repl.js'); repl.startDebugger('break-in-module/main.js'); diff --git a/test/debugger/test-debugger-repl-restart.js b/test/debugger/test-debugger-repl-restart.js index 206cd2e741..7dbef4288a 100644 --- a/test/debugger/test-debugger-repl-restart.js +++ b/test/debugger/test-debugger-repl-restart.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var repl = require('./helper-debugger-repl.js'); +const repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js'); var linesWithBreakpoint = [ diff --git a/test/debugger/test-debugger-repl-term.js b/test/debugger/test-debugger-repl-term.js index 6872f6ce2f..8c44372f68 100644 --- a/test/debugger/test-debugger-repl-term.js +++ b/test/debugger/test-debugger-repl-term.js @@ -2,7 +2,7 @@ require('../common'); process.env.NODE_FORCE_READLINE = 1; -var repl = require('./helper-debugger-repl.js'); +const repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js'); diff --git a/test/debugger/test-debugger-repl-utf8.js b/test/debugger/test-debugger-repl-utf8.js index 6654a49821..1af75840f5 100644 --- a/test/debugger/test-debugger-repl-utf8.js +++ b/test/debugger/test-debugger-repl-utf8.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); var script = common.fixturesDir + '/breakpoints_utf8.js'; process.env.NODE_DEBUGGER_TEST_SCRIPT = script; diff --git a/test/debugger/test-debugger-repl.js b/test/debugger/test-debugger-repl.js index 8a87d40d16..19060d9690 100644 --- a/test/debugger/test-debugger-repl.js +++ b/test/debugger/test-debugger-repl.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var repl = require('./helper-debugger-repl.js'); +const repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js'); diff --git a/test/disabled/test-debug-brk-file.js b/test/disabled/test-debug-brk-file.js index ee20577ded..d697de87d0 100644 --- a/test/disabled/test-debug-brk-file.js +++ b/test/disabled/test-debug-brk-file.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; -var path = require('path'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; +const path = require('path'); +const net = require('net'); var isDone = false; var targetPath = path.resolve(common.fixturesDir, 'debug-target.js'); diff --git a/test/disabled/test-dgram-send-error.js b/test/disabled/test-dgram-send-error.js index 7da60de358..d7ec016540 100644 --- a/test/disabled/test-dgram-send-error.js +++ b/test/disabled/test-dgram-send-error.js @@ -10,7 +10,7 @@ const common = require('../common'); var ITERATIONS = 1000; -var assert = require('assert'), +const assert = require('assert'), dgram = require('dgram'); var buf = Buffer.alloc(1024, 42); diff --git a/test/disabled/test-fs-largefile.js b/test/disabled/test-fs-largefile.js index fb0058b358..b783785484 100644 --- a/test/disabled/test-fs-largefile.js +++ b/test/disabled/test-fs-largefile.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'), +const common = require('../common'); +const assert = require('assert'); +const path = require('path'), fs = require('fs'), filepath = path.join(common.tmpDir, 'large.txt'), fd = fs.openSync(filepath, 'w+'), diff --git a/test/disabled/test-http-abort-stream-end.js b/test/disabled/test-http-abort-stream-end.js index cfa531cedf..3e8bff2124 100644 --- a/test/disabled/test-http-abort-stream-end.js +++ b/test/disabled/test-http-abort-stream-end.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var maxSize = 1024; var size = 0; diff --git a/test/disabled/test-https-loop-to-google.js b/test/disabled/test-https-loop-to-google.js index e498895ed2..2c307f3d17 100644 --- a/test/disabled/test-https-loop-to-google.js +++ b/test/disabled/test-https-loop-to-google.js @@ -5,8 +5,8 @@ // Tested on node 0.5.0-pre commit 9851574 -var common = require('../common'); -var https = require('https'); +const common = require('../common'); +const https = require('https'); for (var i = 0; i < 10; ++i) { https.get({ diff --git a/test/disabled/test-readline.js b/test/disabled/test-readline.js index 9bb9943bd2..7896833b93 100644 --- a/test/disabled/test-readline.js +++ b/test/disabled/test-readline.js @@ -1,9 +1,9 @@ 'use strict'; // Can't test this when 'make test' doesn't assign a tty to the stdout. // Yet another use-case for require('tty').spawn ? -var common = require('../common'); -var assert = require('assert'); -var readline = require('readline'); +const common = require('../common'); +const assert = require('assert'); +const readline = require('readline'); var key = { xterm: { diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index d473cd93c3..969e8b5850 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -26,15 +26,15 @@ // seen in a response yet. This is intended to ensure that all blobs // sent out have been relayed back to us. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var buffer = require('buffer'); -var child_process = require('child_process'); -var fs = require('fs'); -var net = require('net'); +const buffer = require('buffer'); +const child_process = require('child_process'); +const fs = require('fs'); +const net = require('net'); var netBinding = process.binding('net'); -var path = require('path'); +const path = require('path'); var DATA = { 'ppid' : process.pid, diff --git a/test/disabled/test-setuidgid.js b/test/disabled/test-setuidgid.js index bf3726ab00..6b3b578f37 100644 --- a/test/disabled/test-setuidgid.js +++ b/test/disabled/test-setuidgid.js @@ -1,7 +1,7 @@ 'use strict'; // Requires special privileges -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); var oldgid = process.getgid(); process.setgid('nobody'); diff --git a/test/disabled/tls_server.js b/test/disabled/tls_server.js index 1e72809a8a..2347ab4410 100644 --- a/test/disabled/tls_server.js +++ b/test/disabled/tls_server.js @@ -1,11 +1,11 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var util = require('util'); -var net = require('net'); -var fs = require('fs'); -var crypto = require('crypto'); +const util = require('util'); +const net = require('net'); +const fs = require('fs'); +const crypto = require('crypto'); var keyPem = fs.readFileSync(common.fixturesDir + '/cert.pem'); var certPem = fs.readFileSync(common.fixturesDir + '/cert.pem'); diff --git a/test/fixtures/GH-892-request.js b/test/fixtures/GH-892-request.js index 96c355857f..eccbafcf43 100644 --- a/test/fixtures/GH-892-request.js +++ b/test/fixtures/GH-892-request.js @@ -1,8 +1,8 @@ // Called by test/pummel/test-regress-GH-892.js -var https = require('https'); -var fs = require('fs'); -var assert = require('assert'); +const https = require('https'); +const fs = require('fs'); +const assert = require('assert'); var PORT = parseInt(process.argv[2]); var bytesExpected = parseInt(process.argv[3]); diff --git a/test/fixtures/a.js b/test/fixtures/a.js index 990a78534a..1e8bbcf210 100644 --- a/test/fixtures/a.js +++ b/test/fixtures/a.js @@ -1,4 +1,4 @@ -var c = require('./b/c'); +const c = require('./b/c'); console.error('load fixtures/a.js'); diff --git a/test/fixtures/a1.js b/test/fixtures/a1.js index 990a78534a..1e8bbcf210 100644 --- a/test/fixtures/a1.js +++ b/test/fixtures/a1.js @@ -1,4 +1,4 @@ -var c = require('./b/c'); +const c = require('./b/c'); console.error('load fixtures/a.js'); diff --git a/test/fixtures/b/c.js b/test/fixtures/b/c.js index 1b568c2fc9..a27baeb658 100644 --- a/test/fixtures/b/c.js +++ b/test/fixtures/b/c.js @@ -1,8 +1,8 @@ -var d = require('./d'); +const d = require('./d'); -var assert = require('assert'); +const assert = require('assert'); -var package = require('./package'); +const package = require('./package'); assert.equal('world', package.hello); diff --git a/test/fixtures/break-in-module/main.js b/test/fixtures/break-in-module/main.js index cb7074ed2a..cfb44c766a 100644 --- a/test/fixtures/break-in-module/main.js +++ b/test/fixtures/break-in-module/main.js @@ -1,4 +1,4 @@ -var mod = require('./mod.js'); +const mod = require('./mod.js'); mod.hello(); mod.hello(); debugger; diff --git a/test/fixtures/child-process-spawn-node.js b/test/fixtures/child-process-spawn-node.js index 01a494ee59..f93fd998fe 100644 --- a/test/fixtures/child-process-spawn-node.js +++ b/test/fixtures/child-process-spawn-node.js @@ -1,4 +1,4 @@ -var assert = require('assert'); +const assert = require('assert'); function onmessage(m) { console.log('CHILD got message:', m); diff --git a/test/fixtures/child_process_should_emit_error.js b/test/fixtures/child_process_should_emit_error.js index 9f7b2bb80f..34d23fc583 100644 --- a/test/fixtures/child_process_should_emit_error.js +++ b/test/fixtures/child_process_should_emit_error.js @@ -1,4 +1,4 @@ -var exec = require('child_process').exec; +const exec = require('child_process').exec; [0, 1].forEach(function(i) { exec('ls', function(err, stdout, stderr) { diff --git a/test/fixtures/cluster-preload-test.js b/test/fixtures/cluster-preload-test.js index 43d3887b0d..0094fe6657 100644 --- a/test/fixtures/cluster-preload-test.js +++ b/test/fixtures/cluster-preload-test.js @@ -1,4 +1,4 @@ -var cluster = require('cluster'); +const cluster = require('cluster'); if (cluster.isMaster) { cluster.fork(); // one child cluster.on('exit', function(worker, code, signal) { diff --git a/test/fixtures/cluster-preload.js b/test/fixtures/cluster-preload.js index 6637b418ba..26d81d8b7a 100644 --- a/test/fixtures/cluster-preload.js +++ b/test/fixtures/cluster-preload.js @@ -1,12 +1,12 @@ -var assert = require('assert'); +const assert = require('assert'); // https://github.com/nodejs/node/issues/1803 // this module is used as a preload module. It should have a parent with the // module search paths initialized from the current working directory assert.ok(module.parent); -var expectedPaths = require('module')._nodeModulePaths(process.cwd()); +const expectedPaths = require('module')._nodeModulePaths(process.cwd()); assert.deepEqual(module.parent.paths, expectedPaths); -var cluster = require('cluster'); +const cluster = require('cluster'); cluster.isMaster || process.exit(42 + cluster.worker.id); // +42 to distinguish // from exit(1) for other random reasons diff --git a/test/fixtures/create-file.js b/test/fixtures/create-file.js index d6f731b784..1cf417616e 100644 --- a/test/fixtures/create-file.js +++ b/test/fixtures/create-file.js @@ -1,4 +1,4 @@ -var fs = require('fs'); +const fs = require('fs'); var file_name = process.argv[2]; var file_size = parseInt(process.argv[3]); diff --git a/test/fixtures/cycles/folder/foo.js b/test/fixtures/cycles/folder/foo.js index a6b284dd56..573f885f4e 100644 --- a/test/fixtures/cycles/folder/foo.js +++ b/test/fixtures/cycles/folder/foo.js @@ -1,4 +1,4 @@ -var root = require('./../root'); +const root = require('./../root'); exports.hello = function() { return root.calledFromFoo(); diff --git a/test/fixtures/cycles/root.js b/test/fixtures/cycles/root.js index 9b8b2459e6..5e3504e2a6 100644 --- a/test/fixtures/cycles/root.js +++ b/test/fixtures/cycles/root.js @@ -1,4 +1,4 @@ -var foo = exports.foo = require('./folder/foo'); +const foo = exports.foo = require('./folder/foo'); exports.hello = 'hello'; exports.sayHello = function() { diff --git a/test/fixtures/echo-close-check.js b/test/fixtures/echo-close-check.js index 57b2af9567..720bcc9de4 100644 --- a/test/fixtures/echo-close-check.js +++ b/test/fixtures/echo-close-check.js @@ -1,7 +1,7 @@ -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const fs = require('fs'); process.stdout.write('hello world\r\n'); diff --git a/test/fixtures/echo.js b/test/fixtures/echo.js index c03e661d1c..429541b584 100644 --- a/test/fixtures/echo.js +++ b/test/fixtures/echo.js @@ -1,5 +1,5 @@ -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); process.stdout.write('hello world\r\n'); diff --git a/test/fixtures/listen-on-socket-and-exit.js b/test/fixtures/listen-on-socket-and-exit.js index 7fb0d970de..8627625965 100644 --- a/test/fixtures/listen-on-socket-and-exit.js +++ b/test/fixtures/listen-on-socket-and-exit.js @@ -1,7 +1,7 @@ // child process that listens on a socket, allows testing of an EADDRINUSE condition -var common = require('../common'); -var net = require('net'); +const common = require('../common'); +const net = require('net'); common.refreshTmpDir(); diff --git a/test/fixtures/module-require/parent/index.js b/test/fixtures/module-require/parent/index.js index e174cba6ff..52e650bbdb 100644 --- a/test/fixtures/module-require/parent/index.js +++ b/test/fixtures/module-require/parent/index.js @@ -1,4 +1,4 @@ -var child = require('../child'); +const child = require('../child'); //console.log(child.module.require, child.module); console.log(child.module.require('target')); console.log(child.loaded); diff --git a/test/fixtures/node_modules/baz/index.js b/test/fixtures/node_modules/baz/index.js index 859ea0924d..59fc9fe79b 100644 --- a/test/fixtures/node_modules/baz/index.js +++ b/test/fixtures/node_modules/baz/index.js @@ -1,7 +1,7 @@ console.error(__filename); console.error(module.paths.join('\n') + '\n'); // this should work, and get the one that doesn't throw -var assert = require('assert'); +const assert = require('assert'); assert.equal(require('bar'), require('../bar.js')); // this should work, and get the one in ./node_modules/asdf.js diff --git a/test/fixtures/node_modules/foo.js b/test/fixtures/node_modules/foo.js index f69ac7b00e..56a98f76a8 100644 --- a/test/fixtures/node_modules/foo.js +++ b/test/fixtures/node_modules/foo.js @@ -1,4 +1,4 @@ console.error(__filename); console.error(module.paths.join('\n') + '\n'); -var assert = require('assert'); +const assert = require('assert'); assert.equal(require('baz'), require('./baz/index.js')); diff --git a/test/fixtures/not-main-module.js b/test/fixtures/not-main-module.js index 3da57f4428..de024cd92e 100644 --- a/test/fixtures/not-main-module.js +++ b/test/fixtures/not-main-module.js @@ -1,4 +1,4 @@ -var assert = require('assert'); +const assert = require('assert'); assert.notEqual(module, require.main, 'require.main should not == module'); assert.notEqual(module, process.mainModule, 'process.mainModule should not === module'); diff --git a/test/fixtures/parent-process-nonpersistent.js b/test/fixtures/parent-process-nonpersistent.js index a71d1a3882..e55c7bf896 100644 --- a/test/fixtures/parent-process-nonpersistent.js +++ b/test/fixtures/parent-process-nonpersistent.js @@ -1,5 +1,5 @@ -var spawn = require('child_process').spawn, +const spawn = require('child_process').spawn, path = require('path'), childPath = path.join(__dirname, 'child-process-persistent.js'); diff --git a/test/fixtures/path-resolve.js b/test/fixtures/path-resolve.js index 00eb3d3691..883d14b73e 100644 --- a/test/fixtures/path-resolve.js +++ b/test/fixtures/path-resolve.js @@ -1,4 +1,4 @@ // Tests resolving a path in the context of a spawned process. // See https://github.com/nodejs/node/issues/7215 -var path = require('path'); +const path = require('path'); console.log(path.resolve(process.argv[2])); diff --git a/test/fixtures/path.js b/test/fixtures/path.js index cdfcec8761..b6323ff059 100644 --- a/test/fixtures/path.js +++ b/test/fixtures/path.js @@ -1,5 +1,5 @@ // This is actually more a fixture than a test. It is used to make -var common = require('../common'); +const common = require('../common'); // sure that require('./path') and require('path') do different things. // It has to be in the same directory as the test 'test-module-loading.js' // and it has to have the same name as an internal module. diff --git a/test/fixtures/print-chars-from-buffer.js b/test/fixtures/print-chars-from-buffer.js index fc902a896f..b2f4ac4358 100644 --- a/test/fixtures/print-chars-from-buffer.js +++ b/test/fixtures/print-chars-from-buffer.js @@ -1,4 +1,4 @@ -var assert = require('assert'); +const assert = require('assert'); var n = parseInt(process.argv[2]); diff --git a/test/fixtures/print-chars.js b/test/fixtures/print-chars.js index b9707fbf75..e350a025a5 100644 --- a/test/fixtures/print-chars.js +++ b/test/fixtures/print-chars.js @@ -1,4 +1,4 @@ -var assert = require('assert'); +const assert = require('assert'); var n = parseInt(process.argv[2]); diff --git a/test/fixtures/recvfd.js b/test/fixtures/recvfd.js index 75df69a3dc..4c9d96ffe0 100644 --- a/test/fixtures/recvfd.js +++ b/test/fixtures/recvfd.js @@ -1,7 +1,7 @@ // See test/simple/test-sendfd.js for a complete description of what this // script is doing and how it fits into the test as a whole. -var net = require('net'); +const net = require('net'); var receivedData = []; var receivedFDs = []; diff --git a/test/fixtures/stdio-filter.js b/test/fixtures/stdio-filter.js index 8e4f503051..cc0e53c39d 100644 --- a/test/fixtures/stdio-filter.js +++ b/test/fixtures/stdio-filter.js @@ -1,4 +1,4 @@ -var util = require('util'); +const util = require('util'); var regexIn = process.argv[2]; var replacement = process.argv[3]; diff --git a/test/fixtures/test-init-native/fs.js b/test/fixtures/test-init-native/fs.js index 6b47b418f4..6481485d22 100644 --- a/test/fixtures/test-init-native/fs.js +++ b/test/fixtures/test-init-native/fs.js @@ -1,5 +1,5 @@ (function() { - var fs = require('fs'); + const fs = require('fs'); if (fs.readFile) { require('util').print('fs loaded successfully'); } diff --git a/test/fixtures/test-regress-GH-4015.js b/test/fixtures/test-regress-GH-4015.js index 0d9c05d6d7..9f947fa091 100644 --- a/test/fixtures/test-regress-GH-4015.js +++ b/test/fixtures/test-regress-GH-4015.js @@ -1,4 +1,4 @@ -var fs = require('fs'); +const fs = require('fs'); function load() { fs.statSync('.'); diff --git a/test/fixtures/uncaught-exceptions/domain.js b/test/fixtures/uncaught-exceptions/domain.js index c00b22dbb9..9ede6993a7 100644 --- a/test/fixtures/uncaught-exceptions/domain.js +++ b/test/fixtures/uncaught-exceptions/domain.js @@ -1,4 +1,4 @@ -var domain = require('domain'); +const domain = require('domain'); var d = domain.create(); d.on('error', function(err) { diff --git a/test/gc/node_modules/bindings/README.md b/test/gc/node_modules/bindings/README.md index 585cf512b9..2dc83f5d85 100644 --- a/test/gc/node_modules/bindings/README.md +++ b/test/gc/node_modules/bindings/README.md @@ -35,7 +35,7 @@ Example and architecture is as simple as: ``` js -var bindings = require('bindings')('binding.node') +const bindings = require('bindings')('binding.node') // Use your bindings defined in your C files bindings.your_c_function() diff --git a/test/gc/node_modules/bindings/bindings.js b/test/gc/node_modules/bindings/bindings.js index 93dcf85a18..b60ff631cc 100644 --- a/test/gc/node_modules/bindings/bindings.js +++ b/test/gc/node_modules/bindings/bindings.js @@ -3,7 +3,7 @@ * Module dependencies. */ -var fs = require('fs') +const fs = require('fs') , path = require('path') , join = path.join , dirname = path.dirname diff --git a/test/gc/node_modules/nan/tools/1to2.js b/test/gc/node_modules/nan/tools/1to2.js index 15d1564818..3464857ace 100755 --- a/test/gc/node_modules/nan/tools/1to2.js +++ b/test/gc/node_modules/nan/tools/1to2.js @@ -7,7 +7,7 @@ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md> ********************************************************************/ -var commander = require('commander'), +const commander = require('commander'), fs = require('fs'), glob = require('glob'), groups = [], diff --git a/test/gc/node_modules/weak/README.md b/test/gc/node_modules/weak/README.md index c153bb509c..1dad235ce1 100644 --- a/test/gc/node_modules/weak/README.md +++ b/test/gc/node_modules/weak/README.md @@ -36,7 +36,7 @@ Here's an example of calling a `cleanup()` function on a Object before it gets garbage collected: ``` js -var weak = require('weak') +const weak = require('weak') // we are going to "monitor" this Object and invoke "cleanup" // before the object is garbage collected @@ -80,7 +80,7 @@ at the highest scope possible (top-level being the best). Named functions work really well for this: ``` js -var http = require('http') +const http = require('http') , weak = require('weak') http.createServer(function (req, res) { diff --git a/test/gc/node_modules/weak/build/Makefile b/test/gc/node_modules/weak/build/Makefile index ab2f0190ef..0fd5a88f9d 100644 --- a/test/gc/node_modules/weak/build/Makefile +++ b/test/gc/node_modules/weak/build/Makefile @@ -326,7 +326,7 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ endif quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /Users/trott/io.js/deps/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/trott/io.js/test/gc/node_modules/weak/build/config.gypi -I/Users/trott/io.js/deps/npm/node_modules/node-gyp/addon.gypi -I/Users/trott/io.js/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/trott/io.js" "-Dnode_gyp_dir=/Users/trott/io.js/deps/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/Users/trott/io.js/test/gc/node_modules/weak" binding.gyp +cmd_regen_makefile = cd $(srcdir); /Users/cjihrig/iojs/node/deps/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/cjihrig/iojs/node/test/gc/node_modules/weak/build/config.gypi -I/Users/cjihrig/iojs/node/deps/npm/node_modules/node-gyp/addon.gypi -I/Users/cjihrig/iojs/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/cjihrig/iojs/node" "-Dnode_gyp_dir=/Users/cjihrig/iojs/node/deps/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/Users/cjihrig/iojs/node/test/gc/node_modules/weak" binding.gyp Makefile: $(srcdir)/../../../../deps/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../common.gypi $(call do_cmd,regen_makefile) diff --git a/test/gc/node_modules/weak/build/config.gypi b/test/gc/node_modules/weak/build/config.gypi index 9354987d41..ce322bc5f3 100644 --- a/test/gc/node_modules/weak/build/config.gypi +++ b/test/gc/node_modules/weak/build/config.gypi @@ -9,47 +9,58 @@ }, "variables": { "asan": 0, + "coverage": "false", + "debug_devtools": "node", + "force_dynamic_crt": 0, "host_arch": "x64", - "icu_data_file": "icudt57l.dat", - "icu_data_in": "../../deps/icu-small/source/data/in/icudt57l.dat", + "icu_data_file": "icudt58l.dat", + "icu_data_in": "../../deps/icu-small/source/data/in/icudt58l.dat", "icu_endianness": "l", "icu_gyp_path": "tools/icu/icu-generic.gyp", "icu_locales": "en,root", "icu_path": "deps/icu-small", "icu_small": "true", - "icu_ver_major": "57", + "icu_ver_major": "58", "llvm_version": 0, "node_byteorder": "little", + "node_enable_d8": "false", "node_enable_v8_vtunejit": "false", "node_install_npm": "true", + "node_module_version": 51, "node_no_browser_globals": "false", "node_prefix": "/usr/local", "node_release_urlbase": "", + "node_shared": "false", "node_shared_cares": "false", "node_shared_http_parser": "false", "node_shared_libuv": "false", "node_shared_openssl": "false", "node_shared_zlib": "false", "node_tag": "", + "node_use_bundled_v8": "true", "node_use_dtrace": "true", "node_use_etw": "false", "node_use_lttng": "false", "node_use_openssl": "true", "node_use_perfctr": "false", + "node_use_v8_platform": "true", "openssl_fips": "", "openssl_no_asm": 0, + "shlib_suffix": "51.dylib", "target_arch": "x64", "uv_parent_path": "/deps/uv/", "uv_use_dtrace": "true", "v8_enable_gdbjit": 0, "v8_enable_i18n_support": 1, + "v8_inspector": "true", "v8_no_strict_aliasing": 1, "v8_optimized_debug": 0, "v8_random_seed": 0, "v8_use_snapshot": "true", "want_separate_host_toolset": 0, - "xcode_version": "7.0", - "nodedir": "/Users/trott/io.js", + "want_separate_host_toolset_mkpeephole": 0, + "xcode_version": "8.0", + "nodedir": "/Users/cjihrig/iojs/node", "copy_dev_lib": "false", "standalone_static_library": 1 } diff --git a/test/gc/node_modules/weak/build/weakref.target.mk b/test/gc/node_modules/weak/build/weakref.target.mk index 8572d7412f..bb8d2bd72f 100644 --- a/test/gc/node_modules/weak/build/weakref.target.mk +++ b/test/gc/node_modules/weak/build/weakref.target.mk @@ -4,6 +4,9 @@ TOOLSET := target TARGET := weakref DEFS_Debug := \ '-DNODE_GYP_MODULE_NAME=weakref' \ + '-DUSING_UV_SHARED=1' \ + '-DUSING_V8_SHARED=1' \ + '-DV8_DEPRECATION_WARNINGS=1' \ '-D_DARWIN_USE_64_BIT_INODE=1' \ '-D_LARGEFILE_SOURCE' \ '-D_FILE_OFFSET_BITS=64' \ @@ -29,6 +32,7 @@ CFLAGS_C_Debug := \ # Flags passed to only C++ files. CFLAGS_CC_Debug := \ -std=gnu++0x \ + -stdlib=libc++ \ -fno-rtti \ -fno-exceptions \ -fno-threadsafe-statics \ @@ -41,14 +45,17 @@ CFLAGS_OBJC_Debug := CFLAGS_OBJCC_Debug := INCS_Debug := \ - -I/Users/trott/io.js/include/node \ - -I/Users/trott/io.js/src \ - -I/Users/trott/io.js/deps/uv/include \ - -I/Users/trott/io.js/deps/v8/include \ + -I/Users/cjihrig/iojs/node/include/node \ + -I/Users/cjihrig/iojs/node/src \ + -I/Users/cjihrig/iojs/node/deps/uv/include \ + -I/Users/cjihrig/iojs/node/deps/v8/include \ -I$(srcdir)/../nan DEFS_Release := \ '-DNODE_GYP_MODULE_NAME=weakref' \ + '-DUSING_UV_SHARED=1' \ + '-DUSING_V8_SHARED=1' \ + '-DV8_DEPRECATION_WARNINGS=1' \ '-D_DARWIN_USE_64_BIT_INODE=1' \ '-D_LARGEFILE_SOURCE' \ '-D_FILE_OFFSET_BITS=64' \ @@ -72,6 +79,7 @@ CFLAGS_C_Release := \ # Flags passed to only C++ files. CFLAGS_CC_Release := \ -std=gnu++0x \ + -stdlib=libc++ \ -fno-rtti \ -fno-exceptions \ -fno-threadsafe-statics \ @@ -84,10 +92,10 @@ CFLAGS_OBJC_Release := CFLAGS_OBJCC_Release := INCS_Release := \ - -I/Users/trott/io.js/include/node \ - -I/Users/trott/io.js/src \ - -I/Users/trott/io.js/deps/uv/include \ - -I/Users/trott/io.js/deps/v8/include \ + -I/Users/cjihrig/iojs/node/include/node \ + -I/Users/cjihrig/iojs/node/src \ + -I/Users/cjihrig/iojs/node/deps/uv/include \ + -I/Users/cjihrig/iojs/node/deps/v8/include \ -I$(srcdir)/../nan OBJS := \ @@ -125,7 +133,8 @@ LDFLAGS_Debug := \ -Wl,-search_paths_first \ -mmacosx-version-min=10.7 \ -arch x86_64 \ - -L$(builddir) + -L$(builddir) \ + -stdlib=libc++ LIBTOOLFLAGS_Debug := \ -undefined dynamic_lookup \ @@ -138,7 +147,8 @@ LDFLAGS_Release := \ -Wl,-search_paths_first \ -mmacosx-version-min=10.7 \ -arch x86_64 \ - -L$(builddir) + -L$(builddir) \ + -stdlib=libc++ LIBTOOLFLAGS_Release := \ -undefined dynamic_lookup \ diff --git a/test/gc/node_modules/weak/lib/weak.js b/test/gc/node_modules/weak/lib/weak.js index 5502b0de20..66ba2e7138 100644 --- a/test/gc/node_modules/weak/lib/weak.js +++ b/test/gc/node_modules/weak/lib/weak.js @@ -3,8 +3,8 @@ * Module dependencies. */ -var Emitter = require('events').EventEmitter; -var bindings = require('bindings')('weakref.node'); +const Emitter = require('events').EventEmitter; +const bindings = require('bindings')('weakref.node'); /** * Set global weak callback function. diff --git a/test/internet/test-dgram-send-cb-quelches-error.js b/test/internet/test-dgram-send-cb-quelches-error.js index 56612edead..e20c8e1070 100644 --- a/test/internet/test-dgram-send-cb-quelches-error.js +++ b/test/internet/test-dgram-send-cb-quelches-error.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); var mustCall = common.mustCall; -var assert = require('assert'); -var dgram = require('dgram'); -var dns = require('dns'); +const assert = require('assert'); +const dgram = require('dgram'); +const dns = require('dns'); var socket = dgram.createSocket('udp4'); var buffer = Buffer.from('gary busey'); diff --git a/test/internet/test-dns-cares-domains.js b/test/internet/test-dns-cares-domains.js index 76ebf0d628..61ac679274 100644 --- a/test/internet/test-dns-cares-domains.js +++ b/test/internet/test-dns-cares-domains.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var dns = require('dns'); -var domain = require('domain'); +const assert = require('assert'); +const dns = require('dns'); +const domain = require('domain'); var methods = [ 'resolve4', diff --git a/test/internet/test-dns-txt-sigsegv.js b/test/internet/test-dns-txt-sigsegv.js index 4c2f12f7a9..3c85d546cf 100644 --- a/test/internet/test-dns-txt-sigsegv.js +++ b/test/internet/test-dns-txt-sigsegv.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var dns = require('dns'); +const assert = require('assert'); +const dns = require('dns'); dns.resolveTxt('www.microsoft.com', function(err, records) { assert.equal(err, null); diff --git a/test/internet/test-http-https-default-ports.js b/test/internet/test-http-https-default-ports.js index 8b00e434e9..c7e6b3baf7 100644 --- a/test/internet/test-http-https-default-ports.js +++ b/test/internet/test-http-https-default-ports.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var http = require('http'); +const http = require('http'); https.get('https://www.google.com/', common.mustCall(function(res) { res.resume(); diff --git a/test/internet/test-net-connect-timeout.js b/test/internet/test-net-connect-timeout.js index 0f58622aa1..e379f41467 100644 --- a/test/internet/test-net-connect-timeout.js +++ b/test/internet/test-net-connect-timeout.js @@ -4,8 +4,8 @@ // https://groups.google.com/forum/#!topic/nodejs-dev/jR7-5UDqXkw const common = require('../common'); -var net = require('net'); -var assert = require('assert'); +const net = require('net'); +const assert = require('assert'); var start = new Date(); diff --git a/test/internet/test-net-connect-unref.js b/test/internet/test-net-connect-unref.js index 52929d2152..fa45cc711e 100644 --- a/test/internet/test-net-connect-unref.js +++ b/test/internet/test-net-connect-unref.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var client; var TIMEOUT = 10 * 1000; diff --git a/test/internet/test-tls-connnect-melissadata.js b/test/internet/test-tls-connnect-melissadata.js index 7ab7f2aa7a..3c6c205d6e 100644 --- a/test/internet/test-tls-connnect-melissadata.js +++ b/test/internet/test-tls-connnect-melissadata.js @@ -2,13 +2,13 @@ // Test for authorized access to the server which has a cross root // certification between Starfield Class 2 and ValiCert Class 2 -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); var socket = tls.connect(443, 'address.melissadata.net', function() { socket.resume(); socket.destroy(); diff --git a/test/message/error_exit.js b/test/message/error_exit.js index 18d9dfb4ee..7235801514 100644 --- a/test/message/error_exit.js +++ b/test/message/error_exit.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); process.on('exit', function(code) { console.error('Exiting with code=%d', code); diff --git a/test/message/eval_messages.js b/test/message/eval_messages.js index bb1569601c..188311851c 100644 --- a/test/message/eval_messages.js +++ b/test/message/eval_messages.js @@ -2,7 +2,7 @@ require('../common'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; function run(cmd, strict, cb) { var args = []; diff --git a/test/message/stdin_messages.js b/test/message/stdin_messages.js index 6e1ced4124..4759e2b0d5 100644 --- a/test/message/stdin_messages.js +++ b/test/message/stdin_messages.js @@ -2,7 +2,7 @@ require('../common'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; function run(cmd, strict, cb) { var args = []; diff --git a/test/message/undefined_reference_in_new_context.js b/test/message/undefined_reference_in_new_context.js index 73821ae53d..77c5e1e291 100644 --- a/test/message/undefined_reference_in_new_context.js +++ b/test/message/undefined_reference_in_new_context.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var vm = require('vm'); +const vm = require('vm'); console.error('before'); diff --git a/test/message/vm_display_runtime_error.js b/test/message/vm_display_runtime_error.js index a7ca990744..861e87f2f2 100644 --- a/test/message/vm_display_runtime_error.js +++ b/test/message/vm_display_runtime_error.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var vm = require('vm'); +const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_display_syntax_error.js b/test/message/vm_display_syntax_error.js index 62bbd432a2..02612fb92d 100644 --- a/test/message/vm_display_syntax_error.js +++ b/test/message/vm_display_syntax_error.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var vm = require('vm'); +const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_dont_display_runtime_error.js b/test/message/vm_dont_display_runtime_error.js index 19d0120a90..6a96243a83 100644 --- a/test/message/vm_dont_display_runtime_error.js +++ b/test/message/vm_dont_display_runtime_error.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var vm = require('vm'); +const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_dont_display_syntax_error.js b/test/message/vm_dont_display_syntax_error.js index bff0433a14..76c3043330 100644 --- a/test/message/vm_dont_display_syntax_error.js +++ b/test/message/vm_dont_display_syntax_error.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var vm = require('vm'); +const vm = require('vm'); console.error('beginning'); diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index eb98334541..9981e41b1f 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var a = require('assert'); +const assert = require('assert'); +const a = require('assert'); function makeBlock(f) { var args = Array.prototype.slice.call(arguments, 1); diff --git a/test/parallel/test-beforeexit-event-exit.js b/test/parallel/test-beforeexit-event-exit.js index 67676a7990..6878135ce4 100644 --- a/test/parallel/test-beforeexit-event-exit.js +++ b/test/parallel/test-beforeexit-event-exit.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); process.on('beforeExit', function() { assert(false, 'exit should not allow this to occur'); diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index 0abf1289f0..59277dcabe 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var child_process = require('child_process'); +const assert = require('assert'); +const child_process = require('child_process'); var ChildProcess = child_process.ChildProcess; assert.strictEqual(typeof ChildProcess, 'function'); diff --git a/test/parallel/test-child-process-default-options.js b/test/parallel/test-child-process-default-options.js index 38a1b291b9..2c60e274de 100644 --- a/test/parallel/test-child-process-default-options.js +++ b/test/parallel/test-child-process-default-options.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; process.env.HELLO = 'WORLD'; diff --git a/test/parallel/test-child-process-env.js b/test/parallel/test-child-process-env.js index 2ebc653e9a..cac82b9952 100644 --- a/test/parallel/test-child-process-env.js +++ b/test/parallel/test-child-process-env.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; var env = { 'HELLO': 'WORLD' diff --git a/test/parallel/test-child-process-exit-code.js b/test/parallel/test-child-process-exit-code.js index 3a393f126f..2bd1256fe2 100644 --- a/test/parallel/test-child-process-exit-code.js +++ b/test/parallel/test-child-process-exit-code.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; +const path = require('path'); var exitScript = path.join(common.fixturesDir, 'exit.js'); var exitChild = spawn(process.argv[0], [exitScript, 23]); diff --git a/test/parallel/test-child-process-fork-exec-argv.js b/test/parallel/test-child-process-fork-exec-argv.js index 5ccc17fb3f..2daef37b66 100644 --- a/test/parallel/test-child-process-fork-exec-argv.js +++ b/test/parallel/test-child-process-fork-exec-argv.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var child_process = require('child_process'); +const assert = require('assert'); +const child_process = require('child_process'); var spawn = child_process.spawn; var fork = child_process.fork; diff --git a/test/parallel/test-child-process-fork-exec-path.js b/test/parallel/test-child-process-fork-exec-path.js index e2f7e4b4d2..e9938d8ba1 100644 --- a/test/parallel/test-child-process-fork-exec-path.js +++ b/test/parallel/test-child-process-fork-exec-path.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); var msg = {test: 'this'}; var nodePath = process.execPath; var copyPath = path.join(common.tmpDir, 'node-copy.exe'); @@ -25,7 +25,7 @@ if (process.env.FORK) { // slow but simple var envCopy = JSON.parse(JSON.stringify(process.env)); envCopy.FORK = 'true'; - var child = require('child_process').fork(__filename, { + const child = require('child_process').fork(__filename, { execPath: copyPath, env: envCopy }); diff --git a/test/parallel/test-child-process-fork-net2.js b/test/parallel/test-child-process-fork-net2.js index be1ee5d3a4..cee5c0a4ca 100644 --- a/test/parallel/test-child-process-fork-net2.js +++ b/test/parallel/test-child-process-fork-net2.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var fork = require('child_process').fork; -var net = require('net'); +const assert = require('assert'); +const fork = require('child_process').fork; +const net = require('net'); var count = 12; if (process.argv[2] === 'child') { diff --git a/test/parallel/test-child-process-fork-ref.js b/test/parallel/test-child-process-fork-ref.js index 50a944e71b..46eaab584f 100644 --- a/test/parallel/test-child-process-fork-ref.js +++ b/test/parallel/test-child-process-fork-ref.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var fork = require('child_process').fork; +const assert = require('assert'); +const fork = require('child_process').fork; if (process.argv[2] === 'child') { process.send('1'); diff --git a/test/parallel/test-child-process-fork-ref2.js b/test/parallel/test-child-process-fork-ref2.js index 42c43ed888..6d6c56b6b3 100644 --- a/test/parallel/test-child-process-fork-ref2.js +++ b/test/parallel/test-child-process-fork-ref2.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var fork = require('child_process').fork; +const fork = require('child_process').fork; if (process.argv[2] === 'child') { console.log('child -> call disconnect'); diff --git a/test/parallel/test-child-process-fork.js b/test/parallel/test-child-process-fork.js index a7d4a995a3..a8548eff58 100644 --- a/test/parallel/test-child-process-fork.js +++ b/test/parallel/test-child-process-fork.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var fork = require('child_process').fork; +const assert = require('assert'); +const fork = require('child_process').fork; var args = ['foo', 'bar']; var n = fork(common.fixturesDir + '/child-process-spawn-node.js', args); diff --git a/test/parallel/test-child-process-fork3.js b/test/parallel/test-child-process-fork3.js index fe0e68b6a6..5588c41422 100644 --- a/test/parallel/test-child-process-fork3.js +++ b/test/parallel/test-child-process-fork3.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); -var child_process = require('child_process'); +const common = require('../common'); +const child_process = require('child_process'); child_process.fork(common.fixturesDir + '/empty.js'); // should not hang diff --git a/test/parallel/test-child-process-internal.js b/test/parallel/test-child-process-internal.js index f3e452ef87..5d488f7839 100644 --- a/test/parallel/test-child-process-internal.js +++ b/test/parallel/test-child-process-internal.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); //messages var PREFIX = 'NODE_'; @@ -18,7 +18,7 @@ if (process.argv[2] === 'child') { } else { - var fork = require('child_process').fork; + const fork = require('child_process').fork; var child = fork(process.argv[1], ['child']); child.once('message', common.mustCall(function(data) { diff --git a/test/parallel/test-child-process-set-blocking.js b/test/parallel/test-child-process-set-blocking.js index fb0b11f433..5a542fa97e 100644 --- a/test/parallel/test-child-process-set-blocking.js +++ b/test/parallel/test-child-process-set-blocking.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var ch = require('child_process'); +const assert = require('assert'); +const ch = require('child_process'); var SIZE = 100000; diff --git a/test/parallel/test-child-process-silent.js b/test/parallel/test-child-process-silent.js index 50d4ae881a..e087ae1cde 100644 --- a/test/parallel/test-child-process-silent.js +++ b/test/parallel/test-child-process-silent.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var childProcess = require('child_process'); +const assert = require('assert'); +const childProcess = require('child_process'); // Child pipe test if (process.argv[2] === 'pipe') { diff --git a/test/parallel/test-child-process-spawnsync-env.js b/test/parallel/test-child-process-spawnsync-env.js index 4455b867e3..05ef18bf72 100644 --- a/test/parallel/test-child-process-spawnsync-env.js +++ b/test/parallel/test-child-process-spawnsync-env.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cp = require('child_process'); +const assert = require('assert'); +const cp = require('child_process'); if (process.argv[2] === 'child') { console.log(process.env.foo); diff --git a/test/parallel/test-child-process-spawnsync-timeout.js b/test/parallel/test-child-process-spawnsync-timeout.js index 122a658259..207315c531 100644 --- a/test/parallel/test-child-process-spawnsync-timeout.js +++ b/test/parallel/test-child-process-spawnsync-timeout.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var spawnSync = require('child_process').spawnSync; +const spawnSync = require('child_process').spawnSync; var TIMER = 200; var SLEEP = 5000; diff --git a/test/parallel/test-child-process-stdin-ipc.js b/test/parallel/test-child-process-stdin-ipc.js index 2ce7c66c20..c4a8064680 100644 --- a/test/parallel/test-child-process-stdin-ipc.js +++ b/test/parallel/test-child-process-stdin-ipc.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; if (process.argv[2] === 'child') { // Just reference stdin, it should start it diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index dc3bb3e9aa..f7b992e4e7 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; if (process.argv[2] === 'parent') parent(); diff --git a/test/parallel/test-cluster-disconnect-with-no-workers.js b/test/parallel/test-cluster-disconnect-with-no-workers.js index 4c2425d82d..4b38720d71 100644 --- a/test/parallel/test-cluster-disconnect-with-no-workers.js +++ b/test/parallel/test-cluster-disconnect-with-no-workers.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); var disconnected; diff --git a/test/parallel/test-cluster-eaddrinuse.js b/test/parallel/test-cluster-eaddrinuse.js index 88b6de2dde..8b94845635 100644 --- a/test/parallel/test-cluster-eaddrinuse.js +++ b/test/parallel/test-cluster-eaddrinuse.js @@ -3,10 +3,10 @@ // leave the master process in a confused state. Releasing the port and // trying again should Just Work[TM]. -var common = require('../common'); -var assert = require('assert'); -var fork = require('child_process').fork; -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const fork = require('child_process').fork; +const net = require('net'); var id = '' + process.argv[2]; diff --git a/test/parallel/test-cluster-fork-env.js b/test/parallel/test-cluster-fork-env.js index 17b7af3d06..735ff73d2a 100644 --- a/test/parallel/test-cluster-fork-env.js +++ b/test/parallel/test-cluster-fork-env.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); if (cluster.isWorker) { const result = cluster.worker.send({ diff --git a/test/parallel/test-cluster-listening-port.js b/test/parallel/test-cluster-listening-port.js index b0fbf94990..ce86205c1e 100644 --- a/test/parallel/test-cluster-listening-port.js +++ b/test/parallel/test-cluster-listening-port.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); if (cluster.isMaster) { cluster.fork(); diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js index 0587eecb4d..a86b469e33 100644 --- a/test/parallel/test-cluster-message.js +++ b/test/parallel/test-cluster-message.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); function forEach(obj, fn) { Object.keys(obj).forEach(function(name, index) { diff --git a/test/parallel/test-cluster-rr-domain-listen.js b/test/parallel/test-cluster-rr-domain-listen.js index 1328483abb..0f39c47ed2 100644 --- a/test/parallel/test-cluster-rr-domain-listen.js +++ b/test/parallel/test-cluster-rr-domain-listen.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var cluster = require('cluster'); -var domain = require('domain'); +const common = require('../common'); +const cluster = require('cluster'); +const domain = require('domain'); // RR is the default for v0.11.9+ so the following line is redundant: // cluster.schedulingPolicy = cluster.SCHED_RR; @@ -10,7 +10,7 @@ if (cluster.isWorker) { var d = domain.create(); d.run(function() { }); - var http = require('http'); + const http = require('http'); http.Server(function() { }).listen(common.PORT, '127.0.0.1'); } else if (cluster.isMaster) { diff --git a/test/parallel/test-cluster-send-deadlock.js b/test/parallel/test-cluster-send-deadlock.js index fa3e113824..062ebf2b13 100644 --- a/test/parallel/test-cluster-send-deadlock.js +++ b/test/parallel/test-cluster-send-deadlock.js @@ -2,10 +2,10 @@ // Testing mutual send of handles: from master to worker, and from worker to // master. -var common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); if (cluster.isMaster) { var worker = cluster.fork(); diff --git a/test/parallel/test-cluster-setup-master-cumulative.js b/test/parallel/test-cluster-setup-master-cumulative.js index 6a55df29d4..977c89a56a 100644 --- a/test/parallel/test-cluster-setup-master-cumulative.js +++ b/test/parallel/test-cluster-setup-master-cumulative.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); assert(cluster.isMaster); diff --git a/test/parallel/test-cluster-setup-master-emit.js b/test/parallel/test-cluster-setup-master-emit.js index aad1cea75e..5b828e7b8e 100644 --- a/test/parallel/test-cluster-setup-master-emit.js +++ b/test/parallel/test-cluster-setup-master-emit.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); assert(cluster.isMaster); diff --git a/test/parallel/test-cluster-setup-master-multiple.js b/test/parallel/test-cluster-setup-master-multiple.js index 5ceff2bddf..a7611b3c23 100644 --- a/test/parallel/test-cluster-setup-master-multiple.js +++ b/test/parallel/test-cluster-setup-master-multiple.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); assert(cluster.isMaster); diff --git a/test/parallel/test-cluster-setup-master.js b/test/parallel/test-cluster-setup-master.js index 66193203fd..4590309f93 100644 --- a/test/parallel/test-cluster-setup-master.js +++ b/test/parallel/test-cluster-setup-master.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); if (cluster.isWorker) { diff --git a/test/parallel/test-cluster-worker-death.js b/test/parallel/test-cluster-worker-death.js index ac32705106..6435232a81 100644 --- a/test/parallel/test-cluster-worker-death.js +++ b/test/parallel/test-cluster-worker-death.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); if (!cluster.isMaster) { process.exit(42); diff --git a/test/parallel/test-cluster-worker-destroy.js b/test/parallel/test-cluster-worker-destroy.js index ca3ac77e7b..30da5954b2 100644 --- a/test/parallel/test-cluster-worker-destroy.js +++ b/test/parallel/test-cluster-worker-destroy.js @@ -9,7 +9,7 @@ const common = require('../common'); const assert = require('assert'); -var cluster = require('cluster'); +const cluster = require('cluster'); var worker1, worker2; if (cluster.isMaster) { diff --git a/test/parallel/test-cluster-worker-events.js b/test/parallel/test-cluster-worker-events.js index 08bf456a73..b77a32353b 100644 --- a/test/parallel/test-cluster-worker-events.js +++ b/test/parallel/test-cluster-worker-events.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); var OK = 2; diff --git a/test/parallel/test-cluster-worker-forced-exit.js b/test/parallel/test-cluster-worker-forced-exit.js index 3e1f7905ee..1d553a9269 100644 --- a/test/parallel/test-cluster-worker-forced-exit.js +++ b/test/parallel/test-cluster-worker-forced-exit.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); +const assert = require('assert'); +const cluster = require('cluster'); var SENTINEL = 42; diff --git a/test/parallel/test-cluster-worker-isconnected.js b/test/parallel/test-cluster-worker-isconnected.js index 985d15ce64..3b17b53e8a 100644 --- a/test/parallel/test-cluster-worker-isconnected.js +++ b/test/parallel/test-cluster-worker-isconnected.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var cluster = require('cluster'); -var assert = require('assert'); +const cluster = require('cluster'); +const assert = require('assert'); if (cluster.isMaster) { var worker = cluster.fork(); diff --git a/test/parallel/test-cluster-worker-isdead.js b/test/parallel/test-cluster-worker-isdead.js index 90454cb860..a80f8410b1 100644 --- a/test/parallel/test-cluster-worker-isdead.js +++ b/test/parallel/test-cluster-worker-isdead.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var cluster = require('cluster'); -var assert = require('assert'); +const cluster = require('cluster'); +const assert = require('assert'); if (cluster.isMaster) { var worker = cluster.fork(); diff --git a/test/parallel/test-cluster-worker-no-exit.js b/test/parallel/test-cluster-worker-no-exit.js index 0cec652b68..9921256c4a 100644 --- a/test/parallel/test-cluster-worker-no-exit.js +++ b/test/parallel/test-cluster-worker-no-exit.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); var destroyed; var success; diff --git a/test/parallel/test-cluster-worker-wait-server-close.js b/test/parallel/test-cluster-worker-wait-server-close.js index bdf60971fe..cb925822a0 100644 --- a/test/parallel/test-cluster-worker-wait-server-close.js +++ b/test/parallel/test-cluster-worker-wait-server-close.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); var serverClosed = false; diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index 5ffe2c3515..1adbf0098a 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); common.globalCheck = false; global.gc = 42; // Not a valid global unless --expose_gc is set. diff --git a/test/parallel/test-console-not-call-toString.js b/test/parallel/test-console-not-call-toString.js index f152e33e98..bf8a59072f 100644 --- a/test/parallel/test-console-not-call-toString.js +++ b/test/parallel/test-console-not-call-toString.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var func = function() {}; var toStringCalled = false; diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index 1dfb2c73b0..24c3163e3b 100644 --- a/test/parallel/test-crypto-certificate.js +++ b/test/parallel/test-crypto-certificate.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; -var fs = require('fs'); +const fs = require('fs'); // Test Certificates var spkacValid = fs.readFileSync(common.fixturesDir + '/spkac.valid'); diff --git a/test/parallel/test-crypto-dh-odd-key.js b/test/parallel/test-crypto-dh-odd-key.js index cb8757efff..92fab2b8c2 100644 --- a/test/parallel/test-crypto-dh-odd-key.js +++ b/test/parallel/test-crypto-dh-odd-key.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); function test() { var odd = Buffer.alloc(39, 'A'); diff --git a/test/parallel/test-crypto-domain.js b/test/parallel/test-crypto-domain.js index ec99857199..fcbbcb8e05 100644 --- a/test/parallel/test-crypto-domain.js +++ b/test/parallel/test-crypto-domain.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const common = require('../common'); +const assert = require('assert'); +const domain = require('domain'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); function test(fn) { var ex = new Error('BAM'); diff --git a/test/parallel/test-crypto-domains.js b/test/parallel/test-crypto-domains.js index 5d8caf37ee..738ed15323 100644 --- a/test/parallel/test-crypto-domains.js +++ b/test/parallel/test-crypto-domains.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var domain = require('domain'); -var assert = require('assert'); +const common = require('../common'); +const domain = require('domain'); +const assert = require('assert'); var d = domain.create(); var expect = ['pbkdf2', 'randomBytes', 'pseudoRandomBytes']; @@ -9,7 +9,7 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); d.on('error', common.mustCall(function(e) { assert.equal(e.message, expect.shift()); diff --git a/test/parallel/test-crypto-fips.js b/test/parallel/test-crypto-fips.js index 24b1af70b7..51ff8ef759 100644 --- a/test/parallel/test-crypto-fips.js +++ b/test/parallel/test-crypto-fips.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawnSync = require('child_process').spawnSync; -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const spawnSync = require('child_process').spawnSync; +const path = require('path'); if (!common.hasCrypto) { common.skip('missing crypto'); diff --git a/test/parallel/test-crypto-from-binary.js b/test/parallel/test-crypto-from-binary.js index 0889541ef6..ec39606506 100644 --- a/test/parallel/test-crypto-from-binary.js +++ b/test/parallel/test-crypto-from-binary.js @@ -3,14 +3,14 @@ // to use buffers by default. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); var EXTERN_APEX = 0xFBEE9; diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index 9e21244345..effbec11e1 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); // Test hashing var a1 = crypto.createHash('sha1').update('Test123').digest('hex'); diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index 5307ea4f6f..418024676a 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); // Test HMAC var h1 = crypto.createHmac('sha1', 'Node') diff --git a/test/parallel/test-crypto-padding-aes256.js b/test/parallel/test-crypto-padding-aes256.js index e835867d61..56854817fc 100644 --- a/test/parallel/test-crypto-padding-aes256.js +++ b/test/parallel/test-crypto-padding-aes256.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 396717ef74..c97c9613cf 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var constants = require('crypto').constants; -var crypto = require('crypto'); +const constants = require('crypto').constants; +const crypto = require('crypto'); // Test certificates var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 6df41409f0..05f29a7104 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); // Test certificates var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js index 1720cc7c4e..06b483b326 100644 --- a/test/parallel/test-crypto-stream.js +++ b/test/parallel/test-crypto-stream.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var stream = require('stream'); -var util = require('util'); +const common = require('../common'); +const assert = require('assert'); +const stream = require('stream'); +const util = require('util'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); // Small stream to buffer converter function Stream2buffer(callback) { diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index fdc2721502..f840c017b4 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); -var tls = require('tls'); +const crypto = require('crypto'); +const tls = require('tls'); crypto.DEFAULT_ENCODING = 'buffer'; -var fs = require('fs'); +const fs = require('fs'); var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); diff --git a/test/parallel/test-cwd-enoent-repl.js b/test/parallel/test-cwd-enoent-repl.js index 1d03bd3e91..da7729b286 100644 --- a/test/parallel/test-cwd-enoent-repl.js +++ b/test/parallel/test-cwd-enoent-repl.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const spawn = require('child_process').spawn; // Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. if (common.isSunOS || common.isWindows || common.isAix) { diff --git a/test/parallel/test-cwd-enoent.js b/test/parallel/test-cwd-enoent.js index c671ef2be4..bb26a6e879 100644 --- a/test/parallel/test-cwd-enoent.js +++ b/test/parallel/test-cwd-enoent.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const spawn = require('child_process').spawn; // Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. if (common.isSunOS || common.isWindows || common.isAix) { diff --git a/test/parallel/test-debug-port-from-cmdline.js b/test/parallel/test-debug-port-from-cmdline.js index abec53cbd3..f0ff853b16 100644 --- a/test/parallel/test-debug-port-from-cmdline.js +++ b/test/parallel/test-debug-port-from-cmdline.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; var debugPort = common.PORT; var args = ['--interactive', '--debug-port=' + debugPort]; diff --git a/test/parallel/test-delayed-require.js b/test/parallel/test-delayed-require.js index bc110388fc..8e07367eb4 100644 --- a/test/parallel/test-delayed-require.js +++ b/test/parallel/test-delayed-require.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var path = require('path'); -var assert = require('assert'); +const common = require('../common'); +const path = require('path'); +const assert = require('assert'); setTimeout(common.mustCall(function() { const a = require(path.join(common.fixturesDir, 'a')); diff --git a/test/parallel/test-dgram-address.js b/test/parallel/test-dgram-address.js index 38729de670..03fcdf3446 100644 --- a/test/parallel/test-dgram-address.js +++ b/test/parallel/test-dgram-address.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var dgram = require('dgram'); +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); // IPv4 Test var socket_ipv4 = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-bind.js b/test/parallel/test-dgram-bind.js index 0bca97fb29..6df102b32d 100644 --- a/test/parallel/test-dgram-bind.js +++ b/test/parallel/test-dgram-bind.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var dgram = require('dgram'); +const assert = require('assert'); +const dgram = require('dgram'); var socket = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-bytes-length.js b/test/parallel/test-dgram-bytes-length.js index 8e2233e9c4..da686d850e 100644 --- a/test/parallel/test-dgram-bytes-length.js +++ b/test/parallel/test-dgram-bytes-length.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var dgram = require('dgram'); +const assert = require('assert'); +const dgram = require('dgram'); var message = Buffer.from('Some bytes'); var client = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-close-is-not-callback.js b/test/parallel/test-dgram-close-is-not-callback.js index 61e0820036..beccc2420d 100644 --- a/test/parallel/test-dgram-close-is-not-callback.js +++ b/test/parallel/test-dgram-close-is-not-callback.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var dgram = require('dgram'); +const common = require('../common'); +const dgram = require('dgram'); var buf = Buffer.alloc(1024, 42); diff --git a/test/parallel/test-dgram-implicit-bind.js b/test/parallel/test-dgram-implicit-bind.js index 8cbb3f771e..25c61903e8 100644 --- a/test/parallel/test-dgram-implicit-bind.js +++ b/test/parallel/test-dgram-implicit-bind.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var dgram = require('dgram'); +const dgram = require('dgram'); var source = dgram.createSocket('udp4'); var target = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-listen-after-bind.js b/test/parallel/test-dgram-listen-after-bind.js index 498a17a0e5..2060a47380 100644 --- a/test/parallel/test-dgram-listen-after-bind.js +++ b/test/parallel/test-dgram-listen-after-bind.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var dgram = require('dgram'); +const assert = require('assert'); +const dgram = require('dgram'); var socket = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-oob-buffer.js b/test/parallel/test-dgram-oob-buffer.js index e52bf7d69b..0bf302e7e3 100644 --- a/test/parallel/test-dgram-oob-buffer.js +++ b/test/parallel/test-dgram-oob-buffer.js @@ -3,8 +3,8 @@ // unreachable host. This error can be reported by sendto() and even by // recvfrom(). Node should not propagate this error to the user. -var common = require('../common'); -var dgram = require('dgram'); +const common = require('../common'); +const dgram = require('dgram'); var socket = dgram.createSocket('udp4'); var buf = Buffer.from([1, 2, 3, 4]); diff --git a/test/parallel/test-dgram-ref.js b/test/parallel/test-dgram-ref.js index 6505ce9b1e..d8981c0b8a 100644 --- a/test/parallel/test-dgram-ref.js +++ b/test/parallel/test-dgram-ref.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var dgram = require('dgram'); +const dgram = require('dgram'); // should not hang, see #1282 dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-regress-4496.js b/test/parallel/test-dgram-regress-4496.js index 4bdd0d6520..2b509d7907 100644 --- a/test/parallel/test-dgram-regress-4496.js +++ b/test/parallel/test-dgram-regress-4496.js @@ -2,8 +2,8 @@ // Remove this test once we support sending strings. require('../common'); -var assert = require('assert'); -var dgram = require('dgram'); +const assert = require('assert'); +const dgram = require('dgram'); // Should throw but not crash. var socket = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-send-bad-arguments.js b/test/parallel/test-dgram-send-bad-arguments.js index a3918697ad..8505c8bb67 100644 --- a/test/parallel/test-dgram-send-bad-arguments.js +++ b/test/parallel/test-dgram-send-bad-arguments.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var dgram = require('dgram'); +const assert = require('assert'); +const dgram = require('dgram'); var buf = Buffer.from('test'); var host = '127.0.0.1'; diff --git a/test/parallel/test-dgram-unref.js b/test/parallel/test-dgram-unref.js index e5f26b6f33..1b95487a30 100644 --- a/test/parallel/test-dgram-unref.js +++ b/test/parallel/test-dgram-unref.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var dgram = require('dgram'); +const dgram = require('dgram'); var s = dgram.createSocket('udp4'); s.bind(); diff --git a/test/parallel/test-dh-padding.js b/test/parallel/test-dh-padding.js index a9cd95225a..35202f6a51 100644 --- a/test/parallel/test-dh-padding.js +++ b/test/parallel/test-dh-padding.js @@ -1,14 +1,14 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -try { - var crypto = require('crypto'); -} catch (e) { +if (!common.hasCrypto) { common.skip('node compiled without OpenSSL.'); return; } +const assert = require('assert'); +const crypto = require('crypto'); + /* This test verifies padding with leading zeroes for shared * secrets that are strictly smaller than the modulus (prime). * See: diff --git a/test/parallel/test-domain-abort-on-uncaught.js b/test/parallel/test-domain-abort-on-uncaught.js index d61debc060..d9183af60b 100644 --- a/test/parallel/test-domain-abort-on-uncaught.js +++ b/test/parallel/test-domain-abort-on-uncaught.js @@ -90,7 +90,7 @@ const tests = [ }); d.run(function() { - var fs = require('fs'); + const fs = require('fs'); fs.exists('/non/existing/file', function onExists(exists) { throw new Error('boom!'); }); @@ -212,7 +212,7 @@ const tests = [ d.run(function() { d2.run(function() { - var fs = require('fs'); + const fs = require('fs'); fs.exists('/non/existing/file', function onExists(exists) { throw new Error('boom!'); }); diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index 1109591fee..8293eb82d2 100644 --- a/test/parallel/test-domain-crypto.js +++ b/test/parallel/test-domain-crypto.js @@ -2,13 +2,13 @@ const common = require('../common'); -try { - var crypto = require('crypto'); -} catch (e) { +if (!common.hasCrypto) { common.skip('node compiled without OpenSSL.'); return; } +const crypto = require('crypto'); + // Pollution of global is intentional as part of test. common.globalCheck = false; // See https://github.com/nodejs/node/commit/d1eff9ab diff --git a/test/parallel/test-domain-enter-exit.js b/test/parallel/test-domain-enter-exit.js index 2973e833f3..5f12a0bd4c 100644 --- a/test/parallel/test-domain-enter-exit.js +++ b/test/parallel/test-domain-enter-exit.js @@ -2,8 +2,8 @@ // Make sure the domain stack is a stack require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const assert = require('assert'); +const domain = require('domain'); function names(array) { return array.map(function(d) { diff --git a/test/parallel/test-domain-exit-dispose-again.js b/test/parallel/test-domain-exit-dispose-again.js index b1911bb40e..2a4ffd655c 100644 --- a/test/parallel/test-domain-exit-dispose-again.js +++ b/test/parallel/test-domain-exit-dispose-again.js @@ -6,8 +6,8 @@ // the same invocation of listOnTimeout, _are_ called. require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const assert = require('assert'); +const domain = require('domain'); var disposalFailed = false; // Repeatedly schedule a timer with a delay different than the timers attached diff --git a/test/parallel/test-domain-exit-dispose.js b/test/parallel/test-domain-exit-dispose.js index 508cec18dc..c53b840bf5 100644 --- a/test/parallel/test-domain-exit-dispose.js +++ b/test/parallel/test-domain-exit-dispose.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var common = require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const common = require('../common'); +const assert = require('assert'); +const domain = require('domain'); // no matter what happens, we should increment a 10 times. var a = 0; diff --git a/test/parallel/test-domain-http-server.js b/test/parallel/test-domain-http-server.js index 26264e8ec9..ee0388b3cd 100644 --- a/test/parallel/test-domain-http-server.js +++ b/test/parallel/test-domain-http-server.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var domain = require('domain'); -var http = require('http'); -var assert = require('assert'); +const domain = require('domain'); +const http = require('http'); +const assert = require('assert'); var objects = { foo: 'bar', baz: {}, num: 42, arr: [1, 2, 3] }; objects.baz.asdf = objects; diff --git a/test/parallel/test-domain-implicit-fs.js b/test/parallel/test-domain-implicit-fs.js index 01a7026ac9..7773bc46d7 100644 --- a/test/parallel/test-domain-implicit-fs.js +++ b/test/parallel/test-domain-implicit-fs.js @@ -2,8 +2,8 @@ // Simple tests of most basic domain functionality. const common = require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const assert = require('assert'); +const domain = require('domain'); var d = new domain.Domain(); @@ -28,7 +28,7 @@ d.on('error', common.mustCall(function(er) { // handles are created. d.run(function() { setTimeout(function() { - var fs = require('fs'); + const fs = require('fs'); fs.readdir(__dirname, function() { fs.open('this file does not exist', 'r', function(er) { assert.ifError(er); diff --git a/test/parallel/test-domain-multi.js b/test/parallel/test-domain-multi.js index cf85dbca46..2e541ab5e4 100644 --- a/test/parallel/test-domain-multi.js +++ b/test/parallel/test-domain-multi.js @@ -2,8 +2,8 @@ // Tests of multiple domains happening at once. require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const assert = require('assert'); +const domain = require('domain'); var caughtA = false; var caughtB = false; @@ -19,7 +19,7 @@ a.on('error', function(er) { }); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { // child domain of a. var b = domain.create(); diff --git a/test/parallel/test-domain-nested-throw.js b/test/parallel/test-domain-nested-throw.js index 69a80b7ab1..008eaaa5f7 100644 --- a/test/parallel/test-domain-nested-throw.js +++ b/test/parallel/test-domain-nested-throw.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var domain = require('domain'); +const domain = require('domain'); var dispose; switch (process.argv[2]) { @@ -19,7 +19,7 @@ switch (process.argv[2]) { function parent() { var node = process.execPath; - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var opt = { stdio: 'inherit' }; var child = spawn(node, [__filename, 'true'], opt); child.on('exit', function(c) { diff --git a/test/parallel/test-domain-nested.js b/test/parallel/test-domain-nested.js index 68c56d0c3c..d0618b5bad 100644 --- a/test/parallel/test-domain-nested.js +++ b/test/parallel/test-domain-nested.js @@ -2,8 +2,8 @@ // Make sure that the nested domains don't cause the domain stack to grow require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const assert = require('assert'); +const domain = require('domain'); process.on('exit', function(c) { assert.equal(domain._stack.length, 0); diff --git a/test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js b/test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js index 78ef3662a2..ade72147e1 100644 --- a/test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js +++ b/test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js @@ -7,7 +7,7 @@ function test() { const d = domain.create(); d.run(function() { - var fs = require('fs'); + const fs = require('fs'); fs.exists('/non/existing/file', function onExists() { throw new Error('boom!'); }); diff --git a/test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js b/test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js index a4eebd50e9..2e86a2125e 100644 --- a/test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js +++ b/test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js @@ -12,7 +12,7 @@ function test() { d.run(function() { d2.run(function() { - var fs = require('fs'); + const fs = require('fs'); fs.exists('/non/existing/file', function onExists() { throw new Error('boom!'); }); diff --git a/test/parallel/test-domain-safe-exit.js b/test/parallel/test-domain-safe-exit.js index 399ae37bcd..c00aa306f1 100644 --- a/test/parallel/test-domain-safe-exit.js +++ b/test/parallel/test-domain-safe-exit.js @@ -2,8 +2,8 @@ // Make sure the domain stack doesn't get clobbered by un-matched .exit() require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const assert = require('assert'); +const domain = require('domain'); var a = domain.create(); var b = domain.create(); diff --git a/test/parallel/test-domain-stack.js b/test/parallel/test-domain-stack.js index e30d3b21f3..5772a56e39 100644 --- a/test/parallel/test-domain-stack.js +++ b/test/parallel/test-domain-stack.js @@ -2,7 +2,7 @@ // Make sure that the domain stack doesn't get out of hand. require('../common'); -var domain = require('domain'); +const domain = require('domain'); var a = domain.create(); a.name = 'a'; diff --git a/test/parallel/test-domain-timers.js b/test/parallel/test-domain-timers.js index d42afa7471..6ddec404cd 100644 --- a/test/parallel/test-domain-timers.js +++ b/test/parallel/test-domain-timers.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var domain = require('domain'); -var assert = require('assert'); +const domain = require('domain'); +const assert = require('assert'); var timeout; diff --git a/test/parallel/test-domain-top-level-error-handler-throw.js b/test/parallel/test-domain-top-level-error-handler-throw.js index b65b940123..8062d10736 100644 --- a/test/parallel/test-domain-top-level-error-handler-throw.js +++ b/test/parallel/test-domain-top-level-error-handler-throw.js @@ -13,7 +13,7 @@ const domainErrHandlerExMessage = 'exception from domain error handler'; const internalExMessage = 'You should NOT see me'; if (process.argv[2] === 'child') { - var domain = require('domain'); + const domain = require('domain'); var d = domain.create(); d.on('error', function() { @@ -26,8 +26,8 @@ if (process.argv[2] === 'child') { }); }); } else { - var fork = require('child_process').fork; - var assert = require('assert'); + const fork = require('child_process').fork; + const assert = require('assert'); var child = fork(process.argv[1], ['child'], {silent: true}); var stderrOutput = ''; diff --git a/test/parallel/test-domain-with-abort-on-uncaught-exception.js b/test/parallel/test-domain-with-abort-on-uncaught-exception.js index 6fb3912e5b..e11935be68 100644 --- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js +++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js @@ -29,7 +29,7 @@ const fs = require('fs'); const domainErrHandlerExMessage = 'exception from domain error handler'; if (process.argv[2] === 'child') { - var domain = require('domain'); + const domain = require('domain'); var d = domain.create(); process.on('uncaughtException', function onUncaughtException() { @@ -80,7 +80,7 @@ if (process.argv[2] === 'child') { throw new Error('Error from domain.run callback'); }); } else { - var exec = require('child_process').exec; + const exec = require('child_process').exec; function testDomainExceptionHandling(cmdLineOption, options) { if (typeof cmdLineOption === 'object') { diff --git a/test/parallel/test-dsa-fips-invalid-key.js b/test/parallel/test-dsa-fips-invalid-key.js index ede3adab66..d0716a3e21 100644 --- a/test/parallel/test-dsa-fips-invalid-key.js +++ b/test/parallel/test-dsa-fips-invalid-key.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasFipsCrypto) { common.skip('node compiled without FIPS OpenSSL.'); return; } -var crypto = require('crypto'); -var fs = require('fs'); +const crypto = require('crypto'); +const fs = require('fs'); var input = 'hello'; diff --git a/test/parallel/test-error-reporting.js b/test/parallel/test-error-reporting.js index 62525a5494..058f99126a 100644 --- a/test/parallel/test-error-reporting.js +++ b/test/parallel/test-error-reporting.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var exec = require('child_process').exec; -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const exec = require('child_process').exec; +const path = require('path'); function errExec(script, callback) { var cmd = '"' + process.argv[0] + '" "' + diff --git a/test/parallel/test-event-emitter-errors.js b/test/parallel/test-event-emitter-errors.js index 3effb999b3..e2c9fa2a0c 100644 --- a/test/parallel/test-event-emitter-errors.js +++ b/test/parallel/test-event-emitter-errors.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var EventEmitter = require('events'); -var assert = require('assert'); +const EventEmitter = require('events'); +const assert = require('assert'); var EE = new EventEmitter(); diff --git a/test/parallel/test-event-emitter-get-max-listeners.js b/test/parallel/test-event-emitter-get-max-listeners.js index 34ffee3600..13f1dcb97c 100644 --- a/test/parallel/test-event-emitter-get-max-listeners.js +++ b/test/parallel/test-event-emitter-get-max-listeners.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var EventEmitter = require('events'); +const assert = require('assert'); +const EventEmitter = require('events'); var emitter = new EventEmitter(); diff --git a/test/parallel/test-event-emitter-listeners-side-effects.js b/test/parallel/test-event-emitter-listeners-side-effects.js index 906138af23..60d64c6614 100644 --- a/test/parallel/test-event-emitter-listeners-side-effects.js +++ b/test/parallel/test-event-emitter-listeners-side-effects.js @@ -1,9 +1,9 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events').EventEmitter; var e = new EventEmitter(); var fl; // foo listeners diff --git a/test/parallel/test-event-emitter-method-names.js b/test/parallel/test-event-emitter-method-names.js index e268e229b0..27c01b2a07 100644 --- a/test/parallel/test-event-emitter-method-names.js +++ b/test/parallel/test-event-emitter-method-names.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var events = require('events'); +const assert = require('assert'); +const events = require('events'); var E = events.EventEmitter.prototype; assert.strictEqual(E.constructor.name, 'EventEmitter'); diff --git a/test/parallel/test-event-emitter-no-error-provided-to-error-event.js b/test/parallel/test-event-emitter-no-error-provided-to-error-event.js index 0a3ecb33d6..99bdeea79d 100644 --- a/test/parallel/test-event-emitter-no-error-provided-to-error-event.js +++ b/test/parallel/test-event-emitter-no-error-provided-to-error-event.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var events = require('events'); -var domain = require('domain'); +const assert = require('assert'); +const events = require('events'); +const domain = require('domain'); var e = new events.EventEmitter(); var d = domain.create(); diff --git a/test/parallel/test-event-emitter-num-args.js b/test/parallel/test-event-emitter-num-args.js index d858692aad..a5660b259e 100644 --- a/test/parallel/test-event-emitter-num-args.js +++ b/test/parallel/test-event-emitter-num-args.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var events = require('events'); +const assert = require('assert'); +const events = require('events'); const e = new events.EventEmitter(); const num_args_emited = []; diff --git a/test/parallel/test-event-emitter-set-max-listeners-side-effects.js b/test/parallel/test-event-emitter-set-max-listeners-side-effects.js index cadaf3adc3..64f7420fb2 100644 --- a/test/parallel/test-event-emitter-set-max-listeners-side-effects.js +++ b/test/parallel/test-event-emitter-set-max-listeners-side-effects.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var events = require('events'); +const assert = require('assert'); +const events = require('events'); var e = new events.EventEmitter(); diff --git a/test/parallel/test-event-emitter-subclass.js b/test/parallel/test-event-emitter-subclass.js index d2651defee..27532dae46 100644 --- a/test/parallel/test-event-emitter-subclass.js +++ b/test/parallel/test-event-emitter-subclass.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var EventEmitter = require('events').EventEmitter; -var util = require('util'); +const assert = require('assert'); +const EventEmitter = require('events').EventEmitter; +const util = require('util'); util.inherits(MyEE, EventEmitter); diff --git a/test/parallel/test-exception-handler.js b/test/parallel/test-exception-handler.js index e0e1b0086d..1e2b2b8901 100644 --- a/test/parallel/test-exception-handler.js +++ b/test/parallel/test-exception-handler.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); var MESSAGE = 'catch me if you can'; diff --git a/test/parallel/test-fs-access.js b/test/parallel/test-fs-access.js index 6da26fe47b..36268351fa 100644 --- a/test/parallel/test-fs-access.js +++ b/test/parallel/test-fs-access.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); var doesNotExist = path.join(common.tmpDir, '__this_should_not_exist'); var readOnlyFile = path.join(common.tmpDir, 'read_only_file'); var readWriteFile = path.join(common.tmpDir, 'read_write_file'); diff --git a/test/parallel/test-fs-exists.js b/test/parallel/test-fs-exists.js index 83e6adaf11..5f9e9f50bf 100644 --- a/test/parallel/test-fs-exists.js +++ b/test/parallel/test-fs-exists.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const assert = require('assert'); +const fs = require('fs'); var f = __filename; fs.exists(f, common.mustCall(function(y) { diff --git a/test/parallel/test-fs-long-path.js b/test/parallel/test-fs-long-path.js index 64585467ed..63b0011821 100644 --- a/test/parallel/test-fs-long-path.js +++ b/test/parallel/test-fs-long-path.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var fs = require('fs'); -var path = require('path'); +const common = require('../common'); +const fs = require('fs'); +const path = require('path'); if (!common.isWindows) { common.skip('this test is Windows-specific.'); diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 2b8e8b8f02..6202311022 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); function unlink(pathname) { try { diff --git a/test/parallel/test-fs-null-bytes.js b/test/parallel/test-fs-null-bytes.js index 3c70d2953c..907fd266ff 100644 --- a/test/parallel/test-fs-null-bytes.js +++ b/test/parallel/test-fs-null-bytes.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); function check(async, sync) { var expected = /Path must be a string without null bytes/; diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index ce7eaad580..9ee896f3cf 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -1,9 +1,9 @@ // Flags: --expose_internals 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var fs = require('fs'); +const fs = require('fs'); var O_APPEND = fs.constants.O_APPEND || 0; var O_CREAT = fs.constants.O_CREAT || 0; diff --git a/test/parallel/test-fs-read-stream-fd.js b/test/parallel/test-fs-read-stream-fd.js index 5af5200e30..3ac432be32 100644 --- a/test/parallel/test-fs-read-stream-fd.js +++ b/test/parallel/test-fs-read-stream-fd.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var fs = require('fs'); -var assert = require('assert'); -var path = require('path'); +const fs = require('fs'); +const assert = require('assert'); +const path = require('path'); var file = path.join(common.tmpDir, '/read_stream_fd_test.txt'); var input = 'hello world'; var output = ''; diff --git a/test/parallel/test-fs-readfile-zero-byte-liar.js b/test/parallel/test-fs-readfile-zero-byte-liar.js index 283a986f8a..bbcbfeb7c9 100644 --- a/test/parallel/test-fs-readfile-zero-byte-liar.js +++ b/test/parallel/test-fs-readfile-zero-byte-liar.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const assert = require('assert'); +const fs = require('fs'); var dataExpected = fs.readFileSync(__filename, 'utf8'); diff --git a/test/parallel/test-fs-sir-writes-alot.js b/test/parallel/test-fs-sir-writes-alot.js index 8e1385ed4d..85feac59dd 100644 --- a/test/parallel/test-fs-sir-writes-alot.js +++ b/test/parallel/test-fs-sir-writes-alot.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var fs = require('fs'); -var assert = require('assert'); -var join = require('path').join; +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); +const join = require('path').join; var filename = join(common.tmpDir, 'out.txt'); diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index 2c844452f0..48e59b8840 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -1,7 +1,7 @@ /* eslint-disable strict */ const common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const assert = require('assert'); +const fs = require('fs'); fs.stat('.', common.mustCall(function(err, stats) { assert.ifError(err); diff --git a/test/parallel/test-fs-stream-double-close.js b/test/parallel/test-fs-stream-double-close.js index df50102937..ae6429a62b 100644 --- a/test/parallel/test-fs-stream-double-close.js +++ b/test/parallel/test-fs-stream-double-close.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var fs = require('fs'); +const common = require('../common'); +const fs = require('fs'); common.refreshTmpDir(); diff --git a/test/parallel/test-fs-symlink-dir-junction-relative.js b/test/parallel/test-fs-symlink-dir-junction-relative.js index d4e32c4b7e..814b0c678e 100644 --- a/test/parallel/test-fs-symlink-dir-junction-relative.js +++ b/test/parallel/test-fs-symlink-dir-junction-relative.js @@ -1,10 +1,10 @@ 'use strict'; // Test creating and resolving relative junction or symbolic link -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); var linkPath1 = path.join(common.tmpDir, 'junction1'); var linkPath2 = path.join(common.tmpDir, 'junction2'); diff --git a/test/parallel/test-fs-sync-fd-leak.js b/test/parallel/test-fs-sync-fd-leak.js index f7cfd25f4b..67150f637d 100644 --- a/test/parallel/test-fs-sync-fd-leak.js +++ b/test/parallel/test-fs-sync-fd-leak.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const assert = require('assert'); +const fs = require('fs'); // ensure that (read|write|append)FileSync() closes the file descriptor fs.openSync = function() { diff --git a/test/parallel/test-fs-truncate-GH-6233.js b/test/parallel/test-fs-truncate-GH-6233.js index acfdd1ccae..ee6ca1ca13 100644 --- a/test/parallel/test-fs-truncate-GH-6233.js +++ b/test/parallel/test-fs-truncate-GH-6233.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); var filename = common.tmpDir + '/truncate-file.txt'; diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index f245a7962d..90ab7abf0f 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var util = require('util'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const util = require('util'); +const fs = require('fs'); var tests_ok = 0; var tests_run = 0; diff --git a/test/parallel/test-fs-write-file-buffer.js b/test/parallel/test-fs-write-file-buffer.js index a23ccc2133..e2c7b1d01e 100644 --- a/test/parallel/test-fs-write-file-buffer.js +++ b/test/parallel/test-fs-write-file-buffer.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var join = require('path').join; -var util = require('util'); -var fs = require('fs'); +const common = require('../common'); +const join = require('path').join; +const util = require('util'); +const fs = require('fs'); var data = [ '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcH', diff --git a/test/parallel/test-fs-write-file-sync.js b/test/parallel/test-fs-write-file-sync.js index 7ae9e122ca..ece5ba48df 100644 --- a/test/parallel/test-fs-write-file-sync.js +++ b/test/parallel/test-fs-write-file-sync.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); var openCount = 0; var mode; var content; diff --git a/test/parallel/test-fs-write-stream-end.js b/test/parallel/test-fs-write-stream-end.js index ade6777d5f..6329aee416 100644 --- a/test/parallel/test-fs-write-stream-end.js +++ b/test/parallel/test-fs-write-stream-end.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); common.refreshTmpDir(); diff --git a/test/parallel/test-fs-write-stream-err.js b/test/parallel/test-fs-write-stream-err.js index c1151b1253..22137329bf 100644 --- a/test/parallel/test-fs-write-stream-err.js +++ b/test/parallel/test-fs-write-stream-err.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); common.refreshTmpDir(); diff --git a/test/parallel/test-fs-write-string-coerce.js b/test/parallel/test-fs-write-string-coerce.js index 75f689b94b..4179ba0332 100644 --- a/test/parallel/test-fs-write-string-coerce.js +++ b/test/parallel/test-fs-write-string-coerce.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var Buffer = require('buffer').Buffer; -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const Buffer = require('buffer').Buffer; +const fs = require('fs'); common.refreshTmpDir(); diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index 270faf1b77..d88f089586 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -15,8 +15,8 @@ assert.strictEqual('bar', baseBar, // eslint-disable-line no-undef 'global.x -> x in base level not working'); -var module = require(path.join(common.fixturesDir, 'global', 'plain')); -const fooBar = module.fooBar; +const mod = require(path.join(common.fixturesDir, 'global', 'plain')); +const fooBar = mod.fooBar; assert.strictEqual('foo', fooBar.foo, 'x -> global.x in sub level not working'); diff --git a/test/parallel/test-http-1.0-keep-alive.js b/test/parallel/test-http-1.0-keep-alive.js index 383f67c90a..301c054fc9 100644 --- a/test/parallel/test-http-1.0-keep-alive.js +++ b/test/parallel/test-http-1.0-keep-alive.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var http = require('http'); -var net = require('net'); +const http = require('http'); +const net = require('net'); // Check that our HTTP server correctly handles HTTP/1.0 keep-alive requests. check([{ diff --git a/test/parallel/test-http-1.0.js b/test/parallel/test-http-1.0.js index d01613de45..926497d002 100644 --- a/test/parallel/test-http-1.0.js +++ b/test/parallel/test-http-1.0.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); var body = 'hello world\n'; diff --git a/test/parallel/test-http-abort-before-end.js b/test/parallel/test-http-abort-before-end.js index ee22dc847b..5e0baf3cdf 100644 --- a/test/parallel/test-http-abort-before-end.js +++ b/test/parallel/test-http-abort-before-end.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var http = require('http'); -var assert = require('assert'); +const http = require('http'); +const assert = require('assert'); var server = http.createServer(common.fail); diff --git a/test/parallel/test-http-abort-client.js b/test/parallel/test-http-abort-client.js index addcec1ef3..9ee2974c46 100644 --- a/test/parallel/test-http-abort-client.js +++ b/test/parallel/test-http-abort-client.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var server = http.Server(function(req, res) { console.log('Server accepted request.'); diff --git a/test/parallel/test-http-agent-destroyed-socket.js b/test/parallel/test-http-agent-destroyed-socket.js index a269363772..3a6cc53658 100644 --- a/test/parallel/test-http-agent-destroyed-socket.js +++ b/test/parallel/test-http-agent-destroyed-socket.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); diff --git a/test/parallel/test-http-agent-error-on-idle.js b/test/parallel/test-http-agent-error-on-idle.js index 59b0109ef1..14a058a6f8 100644 --- a/test/parallel/test-http-agent-error-on-idle.js +++ b/test/parallel/test-http-agent-error-on-idle.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var Agent = http.Agent; var server = http.createServer(function(req, res) { diff --git a/test/parallel/test-http-agent-false.js b/test/parallel/test-http-agent-false.js index 96606028bf..65da4b836a 100644 --- a/test/parallel/test-http-agent-false.js +++ b/test/parallel/test-http-agent-false.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); // sending `agent: false` when `port: null` is also passed in (i.e. the result // of a `url.parse()` call with the default port used, 80 or 443), should not diff --git a/test/parallel/test-http-agent-maxsockets.js b/test/parallel/test-http-agent-maxsockets.js index ea443ff9bd..b71cbd95c4 100644 --- a/test/parallel/test-http-agent-maxsockets.js +++ b/test/parallel/test-http-agent-maxsockets.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var agent = new http.Agent({ keepAlive: true, diff --git a/test/parallel/test-http-agent-no-protocol.js b/test/parallel/test-http-agent-no-protocol.js index 94fd525b90..e2c748b011 100644 --- a/test/parallel/test-http-agent-no-protocol.js +++ b/test/parallel/test-http-agent-no-protocol.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var http = require('http'); -var url = require('url'); +const http = require('http'); +const url = require('url'); var server = http.createServer(common.mustCall(function(req, res) { res.end(); diff --git a/test/parallel/test-http-agent-null.js b/test/parallel/test-http-agent-null.js index f1dfeddea8..426ec3bb76 100644 --- a/test/parallel/test-http-agent-null.js +++ b/test/parallel/test-http-agent-null.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(common.mustCall(function(req, res) { res.end(); diff --git a/test/parallel/test-http-agent.js b/test/parallel/test-http-agent.js index dae982ed51..443af96215 100644 --- a/test/parallel/test-http-agent.js +++ b/test/parallel/test-http-agent.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.Server(function(req, res) { res.writeHead(200); diff --git a/test/parallel/test-http-automatic-headers.js b/test/parallel/test-http-automatic-headers.js index 600be8e43e..b15330342c 100644 --- a/test/parallel/test-http-automatic-headers.js +++ b/test/parallel/test-http-automatic-headers.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.createServer(function(req, res) { res.setHeader('X-Date', 'foo'); diff --git a/test/parallel/test-http-blank-header.js b/test/parallel/test-http-blank-header.js index 13b1a2f3b0..863cbed19d 100644 --- a/test/parallel/test-http-blank-header.js +++ b/test/parallel/test-http-blank-header.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var server = http.createServer(common.mustCall(function(req, res) { assert.equal('GET', req.method); diff --git a/test/parallel/test-http-buffer-sanity.js b/test/parallel/test-http-buffer-sanity.js index 542d4ad5af..d71f3bdb78 100644 --- a/test/parallel/test-http-buffer-sanity.js +++ b/test/parallel/test-http-buffer-sanity.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var bufferSize = 5 * 1024 * 1024; var measuredSize = 0; diff --git a/test/parallel/test-http-byteswritten.js b/test/parallel/test-http-byteswritten.js index bb914439a7..1ef5f2398d 100644 --- a/test/parallel/test-http-byteswritten.js +++ b/test/parallel/test-http-byteswritten.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var body = 'hello world\n'; diff --git a/test/parallel/test-http-chunked-304.js b/test/parallel/test-http-chunked-304.js index 5ea1912b72..0e1ba7a1cb 100644 --- a/test/parallel/test-http-chunked-304.js +++ b/test/parallel/test-http-chunked-304.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); // RFC 2616, section 10.2.5: // diff --git a/test/parallel/test-http-chunked.js b/test/parallel/test-http-chunked.js index bb91dadd15..d8891db6c7 100644 --- a/test/parallel/test-http-chunked.js +++ b/test/parallel/test-http-chunked.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var UTF8_STRING = '南越国是前203年至前111年存在于岭南地区的一个国家,' + '国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、' + diff --git a/test/parallel/test-http-client-abort-event.js b/test/parallel/test-http-client-abort-event.js index c0c1f9e4c7..00c989ca91 100644 --- a/test/parallel/test-http-client-abort-event.js +++ b/test/parallel/test-http-client-abort-event.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { res.end(); }); diff --git a/test/parallel/test-http-client-abort2.js b/test/parallel/test-http-client-abort2.js index 30269a193f..346b781ef0 100644 --- a/test/parallel/test-http-client-abort2.js +++ b/test/parallel/test-http-client-abort2.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { res.end('Hello'); diff --git a/test/parallel/test-http-client-agent.js b/test/parallel/test-http-client-agent.js index 36ed24ec52..8093100fce 100644 --- a/test/parallel/test-http-client-agent.js +++ b/test/parallel/test-http-client-agent.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var name; var max = 3; diff --git a/test/parallel/test-http-client-default-headers-exist.js b/test/parallel/test-http-client-default-headers-exist.js index 9b73f2db32..3a1f528193 100644 --- a/test/parallel/test-http-client-default-headers-exist.js +++ b/test/parallel/test-http-client-default-headers-exist.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var expectedHeaders = { 'DELETE': ['host', 'connection'], diff --git a/test/parallel/test-http-client-encoding.js b/test/parallel/test-http-client-encoding.js index b02463aa51..d2aa8fdcbb 100644 --- a/test/parallel/test-http-client-encoding.js +++ b/test/parallel/test-http-client-encoding.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var http = require('http'); +const http = require('http'); http.createServer(function(req, res) { res.end('ok\n'); diff --git a/test/parallel/test-http-client-get-url.js b/test/parallel/test-http-client-get-url.js index 51f8413b67..0fc8cf47da 100644 --- a/test/parallel/test-http-client-get-url.js +++ b/test/parallel/test-http-client-get-url.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.createServer(common.mustCall(function(req, res) { assert.equal('GET', req.method); diff --git a/test/parallel/test-http-client-parse-error.js b/test/parallel/test-http-client-parse-error.js index cd6f135d88..c7469c1562 100644 --- a/test/parallel/test-http-client-parse-error.js +++ b/test/parallel/test-http-client-parse-error.js @@ -1,9 +1,9 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); -var net = require('net'); +const http = require('http'); +const net = require('net'); var connects = 0; var parseErrors = 0; diff --git a/test/parallel/test-http-client-pipe-end.js b/test/parallel/test-http-client-pipe-end.js index 5b2db49435..04f308e76d 100644 --- a/test/parallel/test-http-client-pipe-end.js +++ b/test/parallel/test-http-client-pipe-end.js @@ -1,8 +1,8 @@ 'use strict'; // see https://github.com/joyent/node/issues/3257 -var common = require('../common'); -var http = require('http'); +const common = require('../common'); +const http = require('http'); var server = http.createServer(function(req, res) { req.resume(); diff --git a/test/parallel/test-http-client-race-2.js b/test/parallel/test-http-client-race-2.js index 632b9f4a21..80a8252528 100644 --- a/test/parallel/test-http-client-race-2.js +++ b/test/parallel/test-http-client-race-2.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); // // Slight variation on test-http-client-race to test for another race diff --git a/test/parallel/test-http-client-race.js b/test/parallel/test-http-client-race.js index 30ebb34fc7..af8e18686b 100644 --- a/test/parallel/test-http-client-race.js +++ b/test/parallel/test-http-client-race.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); var body1_s = '1111111111111111'; var body2_s = '22222'; diff --git a/test/parallel/test-http-client-read-in-error.js b/test/parallel/test-http-client-read-in-error.js index 142c0ee371..96085ae51f 100644 --- a/test/parallel/test-http-client-read-in-error.js +++ b/test/parallel/test-http-client-read-in-error.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var net = require('net'); -var http = require('http'); -var util = require('util'); +const net = require('net'); +const http = require('http'); +const util = require('util'); function Agent() { http.Agent.call(this); diff --git a/test/parallel/test-http-client-timeout-agent.js b/test/parallel/test-http-client-timeout-agent.js index 4ed217c171..84db25f7b0 100644 --- a/test/parallel/test-http-client-timeout-agent.js +++ b/test/parallel/test-http-client-timeout-agent.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var requests_sent = 0; var requests_done = 0; diff --git a/test/parallel/test-http-client-timeout.js b/test/parallel/test-http-client-timeout.js index 402736e9b7..e26c93fe00 100644 --- a/test/parallel/test-http-client-timeout.js +++ b/test/parallel/test-http-client-timeout.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var options = { method: 'GET', diff --git a/test/parallel/test-http-client-upload-buf.js b/test/parallel/test-http-client-upload-buf.js index 512a438ef8..e17a2c5ee5 100644 --- a/test/parallel/test-http-client-upload-buf.js +++ b/test/parallel/test-http-client-upload-buf.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var N = 1024; diff --git a/test/parallel/test-http-client-upload.js b/test/parallel/test-http-client-upload.js index a5c8f5b92b..ce2608fcfd 100644 --- a/test/parallel/test-http-client-upload.js +++ b/test/parallel/test-http-client-upload.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.createServer(common.mustCall(function(req, res) { assert.equal('POST', req.method); diff --git a/test/parallel/test-http-conn-reset.js b/test/parallel/test-http-conn-reset.js index d7852bf32c..f244838bc4 100644 --- a/test/parallel/test-http-conn-reset.js +++ b/test/parallel/test-http-conn-reset.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var options = { host: '127.0.0.1', diff --git a/test/parallel/test-http-content-length.js b/test/parallel/test-http-content-length.js index 9104e5ba0d..fd1c8004ff 100644 --- a/test/parallel/test-http-content-length.js +++ b/test/parallel/test-http-content-length.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var expectedHeadersMultipleWrites = { 'connection': 'close', diff --git a/test/parallel/test-http-contentLength0.js b/test/parallel/test-http-contentLength0.js index 19e90e1513..c4c8699df7 100644 --- a/test/parallel/test-http-contentLength0.js +++ b/test/parallel/test-http-contentLength0.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var http = require('http'); +const http = require('http'); // Simple test of Node's HTTP Client choking on a response // with a 'Content-Length: 0 ' response header. diff --git a/test/parallel/test-http-date-header.js b/test/parallel/test-http-date-header.js index e0b93c1f87..5b9df4c174 100644 --- a/test/parallel/test-http-date-header.js +++ b/test/parallel/test-http-date-header.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var testResBody = 'other stuff!\n'; diff --git a/test/parallel/test-http-default-encoding.js b/test/parallel/test-http-default-encoding.js index 4fb386bf4b..0026540373 100644 --- a/test/parallel/test-http-default-encoding.js +++ b/test/parallel/test-http-default-encoding.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var expected = 'This is a unicode text: سلام'; var result = ''; diff --git a/test/parallel/test-http-default-port.js b/test/parallel/test-http-default-port.js index fcea5aac7b..d26150f4a8 100644 --- a/test/parallel/test-http-default-port.js +++ b/test/parallel/test-http-default-port.js @@ -1,6 +1,13 @@ 'use strict'; const common = require('../common'); + +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const http = require('http'); +const https = require('https'); const assert = require('assert'); const hostExpect = 'localhost'; const fs = require('fs'); @@ -13,12 +20,6 @@ const options = { let gotHttpsResp = false; let gotHttpResp = false; -if (common.hasCrypto) { - var https = require('https'); -} else { - common.skip('missing crypto'); -} - process.on('exit', function() { if (common.hasCrypto) { assert(gotHttpsResp); diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 7d2f235a27..bb3f5d64cb 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -1,11 +1,11 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); // Verify that ECONNRESET is raised when writing to a http request // where the server has ended the socket. -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { setImmediate(function() { res.destroy(); diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index 5e15ab9a3f..2522490251 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -1,15 +1,15 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -const http = require('http'); -if (common.hasCrypto) { - var https = require('https'); -} else { +if (!common.hasCrypto) { common.skip('missing crypto'); + return; } +const assert = require('assert'); +const http = require('http'); +const https = require('https'); + const host = '*'.repeat(256); function do_not_call() { diff --git a/test/parallel/test-http-eof-on-connect.js b/test/parallel/test-http-eof-on-connect.js index 6f70dc2391..765d8b35e7 100644 --- a/test/parallel/test-http-eof-on-connect.js +++ b/test/parallel/test-http-eof-on-connect.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var net = require('net'); -var http = require('http'); +const net = require('net'); +const http = require('http'); // This is a regression test for https://github.com/joyent/node/issues/44 // It is separate from test-http-malformed-request.js because it is only diff --git a/test/parallel/test-http-exceptions.js b/test/parallel/test-http-exceptions.js index b995800760..8ee46316e9 100644 --- a/test/parallel/test-http-exceptions.js +++ b/test/parallel/test-http-exceptions.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { intentionally_not_defined(); // eslint-disable-line no-undef diff --git a/test/parallel/test-http-expect-continue.js b/test/parallel/test-http-expect-continue.js index a0ebf83b33..954d6b6211 100644 --- a/test/parallel/test-http-expect-continue.js +++ b/test/parallel/test-http-expect-continue.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var outstanding_reqs = 0; var test_req_body = 'some stuff...\n'; diff --git a/test/parallel/test-http-extra-response.js b/test/parallel/test-http-extra-response.js index 8364684a1e..1866d88a33 100644 --- a/test/parallel/test-http-extra-response.js +++ b/test/parallel/test-http-extra-response.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); // If an HTTP server is broken and sends data after the end of the response, // node should ignore it and drop the connection. diff --git a/test/parallel/test-http-flush.js b/test/parallel/test-http-flush.js index 8b3dacb803..524965d2d7 100644 --- a/test/parallel/test-http-flush.js +++ b/test/parallel/test-http-flush.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var http = require('http'); +const http = require('http'); http.createServer(function(req, res) { res.end('ok'); diff --git a/test/parallel/test-http-full-response.js b/test/parallel/test-http-full-response.js index e59456a710..be6749cc04 100644 --- a/test/parallel/test-http-full-response.js +++ b/test/parallel/test-http-full-response.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); // This test requires the program 'ab' -var http = require('http'); -var exec = require('child_process').exec; +const http = require('http'); +const exec = require('child_process').exec; var bodyLength = 12345; diff --git a/test/parallel/test-http-get-pipeline-problem.js b/test/parallel/test-http-get-pipeline-problem.js index cc681f675a..d4e075d229 100644 --- a/test/parallel/test-http-get-pipeline-problem.js +++ b/test/parallel/test-http-get-pipeline-problem.js @@ -2,10 +2,10 @@ // In previous versions of Node.js (e.g., 0.6.0), this sort of thing would halt // after http.globalAgent.maxSockets number of files. // See https://groups.google.com/forum/#!topic/nodejs-dev/V5fB69hFa9o -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const fs = require('fs'); http.globalAgent.maxSockets = 1; diff --git a/test/parallel/test-http-head-request.js b/test/parallel/test-http-head-request.js index e8626b1881..eb31930a34 100644 --- a/test/parallel/test-http-head-request.js +++ b/test/parallel/test-http-head-request.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var body = 'hello world\n'; diff --git a/test/parallel/test-http-head-response-has-no-body-end.js b/test/parallel/test-http-head-response-has-no-body-end.js index 87ce957df3..cd2c22c8fa 100644 --- a/test/parallel/test-http-head-response-has-no-body-end.js +++ b/test/parallel/test-http-head-response-has-no-body-end.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); // This test is to make sure that when the HTTP server // responds to a HEAD request with data to res.end, diff --git a/test/parallel/test-http-head-response-has-no-body.js b/test/parallel/test-http-head-response-has-no-body.js index 445b522b8d..17107d3b67 100644 --- a/test/parallel/test-http-head-response-has-no-body.js +++ b/test/parallel/test-http-head-response-has-no-body.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); // This test is to make sure that when the HTTP server // responds to a HEAD request, it does not send any body. diff --git a/test/parallel/test-http-header-read.js b/test/parallel/test-http-header-read.js index b726fe130f..42d7e9af5f 100644 --- a/test/parallel/test-http-header-read.js +++ b/test/parallel/test-http-header-read.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); // Verify that ServerResponse.getHeader() works correctly even after // the response header has been sent. Issue 752 on github. diff --git a/test/parallel/test-http-hex-write.js b/test/parallel/test-http-hex-write.js index adfe18077a..2fcabb0691 100644 --- a/test/parallel/test-http-hex-write.js +++ b/test/parallel/test-http-hex-write.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var expect = 'hex\nutf8\n'; diff --git a/test/parallel/test-http-keep-alive-close-on-header.js b/test/parallel/test-http-keep-alive-close-on-header.js index d9396b258e..b69e90c038 100644 --- a/test/parallel/test-http-keep-alive-close-on-header.js +++ b/test/parallel/test-http-keep-alive-close-on-header.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var body = 'hello world\n'; var headers = {'connection': 'keep-alive'}; diff --git a/test/parallel/test-http-keepalive-client.js b/test/parallel/test-http-keepalive-client.js index 955fc006e2..55c3342a11 100644 --- a/test/parallel/test-http-keepalive-client.js +++ b/test/parallel/test-http-keepalive-client.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var serverSocket = null; diff --git a/test/parallel/test-http-keepalive-maxsockets.js b/test/parallel/test-http-keepalive-maxsockets.js index 6f1476d0ce..ffe1472a3c 100644 --- a/test/parallel/test-http-keepalive-maxsockets.js +++ b/test/parallel/test-http-keepalive-maxsockets.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var serverSockets = []; diff --git a/test/parallel/test-http-keepalive-request.js b/test/parallel/test-http-keepalive-request.js index daae5aa994..102f65bb08 100644 --- a/test/parallel/test-http-keepalive-request.js +++ b/test/parallel/test-http-keepalive-request.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var serverSocket = null; diff --git a/test/parallel/test-http-localaddress-bind-error.js b/test/parallel/test-http-localaddress-bind-error.js index 0b828910f1..0290c6a584 100644 --- a/test/parallel/test-http-localaddress-bind-error.js +++ b/test/parallel/test-http-localaddress-bind-error.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var invalidLocalAddress = '1.2.3.4'; diff --git a/test/parallel/test-http-malformed-request.js b/test/parallel/test-http-malformed-request.js index 647b67bcd3..6739a44b6c 100644 --- a/test/parallel/test-http-malformed-request.js +++ b/test/parallel/test-http-malformed-request.js @@ -1,9 +1,9 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); +const url = require('url'); // Make sure no exceptions are thrown when receiving malformed HTTP // requests. diff --git a/test/parallel/test-http-many-ended-pipelines.js b/test/parallel/test-http-many-ended-pipelines.js index 7966f47a9e..5fa8e53e01 100644 --- a/test/parallel/test-http-many-ended-pipelines.js +++ b/test/parallel/test-http-many-ended-pipelines.js @@ -8,8 +8,8 @@ console.trace = function() { throw new Error('no tracing should happen here'); }; -var http = require('http'); -var net = require('net'); +const http = require('http'); +const net = require('net'); var numRequests = 20; var first = false; diff --git a/test/parallel/test-http-max-headers-count.js b/test/parallel/test-http-max-headers-count.js index 2d68ead110..0abddbd2cb 100644 --- a/test/parallel/test-http-max-headers-count.js +++ b/test/parallel/test-http-max-headers-count.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var requests = 0; var responses = 0; diff --git a/test/parallel/test-http-methods.js b/test/parallel/test-http-methods.js index d3d4fedd46..6ba02807f8 100644 --- a/test/parallel/test-http-methods.js +++ b/test/parallel/test-http-methods.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var util = require('util'); +const assert = require('assert'); +const http = require('http'); +const util = require('util'); assert(Array.isArray(http.METHODS)); assert(http.METHODS.length > 0); diff --git a/test/parallel/test-http-multi-line-headers.js b/test/parallel/test-http-multi-line-headers.js index df333cdd62..9c0d758ed5 100644 --- a/test/parallel/test-http-multi-line-headers.js +++ b/test/parallel/test-http-multi-line-headers.js @@ -1,9 +1,9 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); -var net = require('net'); +const http = require('http'); +const net = require('net'); var server = net.createServer(function(conn) { var body = 'Yet another node.js server.'; diff --git a/test/parallel/test-http-mutable-headers.js b/test/parallel/test-http-mutable-headers.js index 0228a4e216..ecb777c09b 100644 --- a/test/parallel/test-http-mutable-headers.js +++ b/test/parallel/test-http-mutable-headers.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); // Simple test of Node's HTTP Client mutable headers // OutgoingMessage.prototype.setHeader(name, value) diff --git a/test/parallel/test-http-no-content-length.js b/test/parallel/test-http-no-content-length.js index b27ffda727..a393d58d57 100644 --- a/test/parallel/test-http-no-content-length.js +++ b/test/parallel/test-http-no-content-length.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); var server = net.createServer(function(socket) { // Neither Content-Length nor Connection diff --git a/test/parallel/test-http-outgoing-finish.js b/test/parallel/test-http-outgoing-finish.js index 56ce777cb3..06630e6178 100644 --- a/test/parallel/test-http-outgoing-finish.js +++ b/test/parallel/test-http-outgoing-finish.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); http.createServer(function(req, res) { req.resume(); diff --git a/test/parallel/test-http-parser-bad-ref.js b/test/parallel/test-http-parser-bad-ref.js index 73d5f7eb13..9eddb2bb3b 100644 --- a/test/parallel/test-http-parser-bad-ref.js +++ b/test/parallel/test-http-parser-bad-ref.js @@ -5,7 +5,7 @@ // Flags: --expose_gc require('../common'); -var assert = require('assert'); +const assert = require('assert'); var HTTPParser = process.binding('http_parser').HTTPParser; var kOnHeaders = HTTPParser.kOnHeaders | 0; diff --git a/test/parallel/test-http-parser-free.js b/test/parallel/test-http-parser-free.js index 125374bbed..e9ddfa27e5 100644 --- a/test/parallel/test-http-parser-free.js +++ b/test/parallel/test-http-parser-free.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var N = 100; var responses = 0; diff --git a/test/parallel/test-http-parser.js b/test/parallel/test-http-parser.js index abc1d096df..8617a093fb 100644 --- a/test/parallel/test-http-parser.js +++ b/test/parallel/test-http-parser.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); const binding = process.binding('http_parser'); const methods = binding.methods; diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index f6562b3afc..3c96dc6792 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var expectedServer = 'Request Body from Client'; var resultServer = ''; diff --git a/test/parallel/test-http-pipe-fs.js b/test/parallel/test-http-pipe-fs.js index 3205802d7a..5b3eb87a14 100644 --- a/test/parallel/test-http-pipe-fs.js +++ b/test/parallel/test-http-pipe-fs.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var http = require('http'); -var fs = require('fs'); -var path = require('path'); +const common = require('../common'); +const http = require('http'); +const fs = require('fs'); +const path = require('path'); common.refreshTmpDir(); diff --git a/test/parallel/test-http-proxy.js b/test/parallel/test-http-proxy.js index 43feb1e3b3..034b7b4a64 100644 --- a/test/parallel/test-http-proxy.js +++ b/test/parallel/test-http-proxy.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); var cookies = [ 'session_token=; path=/; expires=Sun, 15-Sep-2030 13:48:52 GMT', diff --git a/test/parallel/test-http-raw-headers.js b/test/parallel/test-http-raw-headers.js index 2e2e963149..0c7cc18415 100644 --- a/test/parallel/test-http-raw-headers.js +++ b/test/parallel/test-http-raw-headers.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); http.createServer(function(req, res) { var expectRawHeaders = [ diff --git a/test/parallel/test-http-remove-header-stays-removed.js b/test/parallel/test-http-remove-header-stays-removed.js index 9b8ff35b0f..bf417597b1 100644 --- a/test/parallel/test-http-remove-header-stays-removed.js +++ b/test/parallel/test-http-remove-header-stays-removed.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(request, response) { // removed headers should stay removed, even if node automatically adds them diff --git a/test/parallel/test-http-request-end-twice.js b/test/parallel/test-http-request-end-twice.js index 230175be8e..5dd21d06de 100644 --- a/test/parallel/test-http-request-end-twice.js +++ b/test/parallel/test-http-request-end-twice.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.Server(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); diff --git a/test/parallel/test-http-request-end.js b/test/parallel/test-http-request-end.js index 6beedae20d..207c3564fb 100644 --- a/test/parallel/test-http-request-end.js +++ b/test/parallel/test-http-request-end.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var expected = 'Post Body For Test'; diff --git a/test/parallel/test-http-request-methods.js b/test/parallel/test-http-request-methods.js index 7f42a9c00a..b24779adf8 100644 --- a/test/parallel/test-http-request-methods.js +++ b/test/parallel/test-http-request-methods.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); // Test that the DELETE, PATCH and PURGE verbs get passed through correctly diff --git a/test/parallel/test-http-res-write-after-end.js b/test/parallel/test-http-res-write-after-end.js index 5a91c55634..d01753b88a 100644 --- a/test/parallel/test-http-res-write-after-end.js +++ b/test/parallel/test-http-res-write-after-end.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var server = http.Server(common.mustCall(function(req, res) { res.on('error', common.mustCall(function onResError(err) { diff --git a/test/parallel/test-http-res-write-end-dont-take-array.js b/test/parallel/test-http-res-write-end-dont-take-array.js index 5c14b06785..cbae755b4f 100644 --- a/test/parallel/test-http-res-write-end-dont-take-array.js +++ b/test/parallel/test-http-res-write-end-dont-take-array.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var test = 1; diff --git a/test/parallel/test-http-response-close.js b/test/parallel/test-http-response-close.js index 54ee61efcc..6b5966735a 100644 --- a/test/parallel/test-http-response-close.js +++ b/test/parallel/test-http-response-close.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(common.mustCall(function(req, res) { res.writeHead(200); diff --git a/test/parallel/test-http-response-no-headers.js b/test/parallel/test-http-response-no-headers.js index 4a3460bc64..4c261fc2ad 100644 --- a/test/parallel/test-http-response-no-headers.js +++ b/test/parallel/test-http-response-no-headers.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var expected = { '0.9': 'I AM THE WALRUS', diff --git a/test/parallel/test-http-response-readable.js b/test/parallel/test-http-response-readable.js index 1d561ca470..f8ecd5bab5 100644 --- a/test/parallel/test-http-response-readable.js +++ b/test/parallel/test-http-response-readable.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var testServer = new http.Server(function(req, res) { res.writeHead(200); diff --git a/test/parallel/test-http-response-status-message.js b/test/parallel/test-http-response-status-message.js index b14c1f2faf..cfc9e64209 100644 --- a/test/parallel/test-http-response-status-message.js +++ b/test/parallel/test-http-response-status-message.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var testsComplete = 0; diff --git a/test/parallel/test-http-server-multiheaders.js b/test/parallel/test-http-server-multiheaders.js index 5b41ee89d8..b978cb3ad4 100644 --- a/test/parallel/test-http-server-multiheaders.js +++ b/test/parallel/test-http-server-multiheaders.js @@ -4,8 +4,8 @@ // that support it, and dropping duplicates for other fields. require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var srv = http.createServer(function(req, res) { assert.equal(req.headers.accept, 'abc, def, ghijklmnopqrst'); diff --git a/test/parallel/test-http-server-multiheaders2.js b/test/parallel/test-http-server-multiheaders2.js index 9f6d41e6a1..ba0710f70c 100644 --- a/test/parallel/test-http-server-multiheaders2.js +++ b/test/parallel/test-http-server-multiheaders2.js @@ -4,8 +4,8 @@ // that support it, and dropping duplicates for other fields. require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var multipleAllowed = [ 'Accept', diff --git a/test/parallel/test-http-server-stale-close.js b/test/parallel/test-http-server-stale-close.js index 819f503de5..04e9635403 100644 --- a/test/parallel/test-http-server-stale-close.js +++ b/test/parallel/test-http-server-stale-close.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var http = require('http'); -var util = require('util'); -var fork = require('child_process').fork; +const http = require('http'); +const util = require('util'); +const fork = require('child_process').fork; if (process.env.NODE_TEST_FORK_PORT) { var req = http.request({ diff --git a/test/parallel/test-http-server-unconsume.js b/test/parallel/test-http-server-unconsume.js index 76238380c7..fd5486a289 100644 --- a/test/parallel/test-http-server-unconsume.js +++ b/test/parallel/test-http-server-unconsume.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var received = ''; diff --git a/test/parallel/test-http-server.js b/test/parallel/test-http-server.js index 1870bcc717..c915272af2 100644 --- a/test/parallel/test-http-server.js +++ b/test/parallel/test-http-server.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); -var url = require('url'); -var qs = require('querystring'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); +const url = require('url'); +const qs = require('querystring'); var request_number = 0; var requests_sent = 0; diff --git a/test/parallel/test-http-set-cookies.js b/test/parallel/test-http-set-cookies.js index 1f00ebb65e..3fa01655b4 100644 --- a/test/parallel/test-http-set-cookies.js +++ b/test/parallel/test-http-set-cookies.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var nresponses = 0; diff --git a/test/parallel/test-http-set-timeout-server.js b/test/parallel/test-http-set-timeout-server.js index d530503aa1..03fca8f219 100644 --- a/test/parallel/test-http-set-timeout-server.js +++ b/test/parallel/test-http-set-timeout-server.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var tests = []; diff --git a/test/parallel/test-http-set-trailers.js b/test/parallel/test-http-set-trailers.js index b3f331c6d8..e34ea889b0 100644 --- a/test/parallel/test-http-set-trailers.js +++ b/test/parallel/test-http-set-trailers.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var outstanding_reqs = 0; diff --git a/test/parallel/test-http-should-keep-alive.js b/test/parallel/test-http-should-keep-alive.js index 3aaa2d3d73..5cfbd51e76 100644 --- a/test/parallel/test-http-should-keep-alive.js +++ b/test/parallel/test-http-should-keep-alive.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var SERVER_RESPONSES = [ 'HTTP/1.0 200 ok\r\nContent-Length: 0\r\n\r\n', diff --git a/test/parallel/test-http-status-code.js b/test/parallel/test-http-status-code.js index c0086a3e3d..0b3d204c43 100644 --- a/test/parallel/test-http-status-code.js +++ b/test/parallel/test-http-status-code.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); // Simple test of Node's HTTP ServerResponse.statusCode // ServerResponse.prototype.statusCode diff --git a/test/parallel/test-http-status-message.js b/test/parallel/test-http-status-message.js index 6da4b6e428..9a086dcd46 100644 --- a/test/parallel/test-http-status-message.js +++ b/test/parallel/test-http-status-message.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var s = http.createServer(function(req, res) { res.statusCode = 200; diff --git a/test/parallel/test-http-timeout-overflow.js b/test/parallel/test-http-timeout-overflow.js index 49cf3ec027..c045a28ce7 100644 --- a/test/parallel/test-http-timeout-overflow.js +++ b/test/parallel/test-http-timeout-overflow.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var serverRequests = 0; var clientRequests = 0; diff --git a/test/parallel/test-http-timeout.js b/test/parallel/test-http-timeout.js index b8a28fc2c4..128ca14883 100644 --- a/test/parallel/test-http-timeout.js +++ b/test/parallel/test-http-timeout.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); diff --git a/test/parallel/test-http-upgrade-agent.js b/test/parallel/test-http-upgrade-agent.js index 48eaa16f89..27f21649a7 100644 --- a/test/parallel/test-http-upgrade-agent.js +++ b/test/parallel/test-http-upgrade-agent.js @@ -3,11 +3,11 @@ // the HTTP client. This test uses a raw TCP server to better control server // behavior. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var http = require('http'); -var net = require('net'); +const http = require('http'); +const net = require('net'); // Create a TCP server var srv = net.createServer(function(c) { diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index 51c70122b9..f5c25f15d4 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -3,11 +3,11 @@ // the HTTP client. This test uses a raw TCP server to better control server // behavior. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var http = require('http'); -var net = require('net'); +const http = require('http'); +const net = require('net'); // Create a TCP server var srv = net.createServer(function(c) { diff --git a/test/parallel/test-http-upgrade-client2.js b/test/parallel/test-http-upgrade-client2.js index 0c229a354a..03cb36981a 100644 --- a/test/parallel/test-http-upgrade-client2.js +++ b/test/parallel/test-http-upgrade-client2.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var http = require('http'); +const http = require('http'); var CRLF = '\r\n'; diff --git a/test/parallel/test-http-upgrade-server.js b/test/parallel/test-http-upgrade-server.js index 8570dec899..50183dffe1 100644 --- a/test/parallel/test-http-upgrade-server.js +++ b/test/parallel/test-http-upgrade-server.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var util = require('util'); -var net = require('net'); -var http = require('http'); +const util = require('util'); +const net = require('net'); +const http = require('http'); var requests_recv = 0; diff --git a/test/parallel/test-http-upgrade-server2.js b/test/parallel/test-http-upgrade-server2.js index 1644f54977..e7533b194d 100644 --- a/test/parallel/test-http-upgrade-server2.js +++ b/test/parallel/test-http-upgrade-server2.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); var server = http.createServer(function(req, res) { throw new Error('This shouldn\'t happen.'); diff --git a/test/parallel/test-http-url.parse-auth-with-header-in-request.js b/test/parallel/test-http-url.parse-auth-with-header-in-request.js index fa930bd5ec..9781cefcbd 100644 --- a/test/parallel/test-http-url.parse-auth-with-header-in-request.js +++ b/test/parallel/test-http-url.parse-auth-with-header-in-request.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); function check(request) { // the correct authorization header is be passed diff --git a/test/parallel/test-http-url.parse-auth.js b/test/parallel/test-http-url.parse-auth.js index 0e901ebb59..72e69b14a9 100644 --- a/test/parallel/test-http-url.parse-auth.js +++ b/test/parallel/test-http-url.parse-auth.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); function check(request) { // the correct authorization header is be passed diff --git a/test/parallel/test-http-url.parse-basic.js b/test/parallel/test-http-url.parse-basic.js index b0d1274b59..0fa8f10465 100644 --- a/test/parallel/test-http-url.parse-basic.js +++ b/test/parallel/test-http-url.parse-basic.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); var testURL; diff --git a/test/parallel/test-http-url.parse-https.request.js b/test/parallel/test-http-url.parse-https.request.js index edd83a2d13..ddd1d51475 100644 --- a/test/parallel/test-http-url.parse-https.request.js +++ b/test/parallel/test-http-url.parse-https.request.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var url = require('url'); -var fs = require('fs'); +const url = require('url'); +const fs = require('fs'); // https options var httpsOptions = { diff --git a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js index e7ed828171..b3d7795e72 100644 --- a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js +++ b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); assert.throws(function() { diff --git a/test/parallel/test-http-url.parse-path.js b/test/parallel/test-http-url.parse-path.js index 73de297d45..e5a1306f8e 100644 --- a/test/parallel/test-http-url.parse-path.js +++ b/test/parallel/test-http-url.parse-path.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); function check(request) { // a path should come over diff --git a/test/parallel/test-http-url.parse-post.js b/test/parallel/test-http-url.parse-post.js index 0af482c94a..3ea40de6ec 100644 --- a/test/parallel/test-http-url.parse-post.js +++ b/test/parallel/test-http-url.parse-post.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); var testURL; diff --git a/test/parallel/test-http-url.parse-search.js b/test/parallel/test-http-url.parse-search.js index 9a1e756557..47cc0c03a6 100644 --- a/test/parallel/test-http-url.parse-search.js +++ b/test/parallel/test-http-url.parse-search.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); -var url = require('url'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); function check(request) { // a path should come over with params diff --git a/test/parallel/test-http-wget.js b/test/parallel/test-http-wget.js index f7fb1a3656..795f179477 100644 --- a/test/parallel/test-http-wget.js +++ b/test/parallel/test-http-wget.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var http = require('http'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); // wget sends an HTTP/1.0 request with Connection: Keep-Alive // diff --git a/test/parallel/test-http-write-callbacks.js b/test/parallel/test-http-write-callbacks.js index b89cdf89af..5901025655 100644 --- a/test/parallel/test-http-write-callbacks.js +++ b/test/parallel/test-http-write-callbacks.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var serverEndCb = false; var serverIncoming = ''; diff --git a/test/parallel/test-http-write-empty-string.js b/test/parallel/test-http-write-empty-string.js index 534a55823a..c659c47fa4 100644 --- a/test/parallel/test-http-write-empty-string.js +++ b/test/parallel/test-http-write-empty-string.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(request, response) { console.log('responding to ' + request.url); diff --git a/test/parallel/test-http-write-head.js b/test/parallel/test-http-write-head.js index 32fff6042e..9807dc6943 100644 --- a/test/parallel/test-http-write-head.js +++ b/test/parallel/test-http-write-head.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); // Verify that ServerResponse.writeHead() works as setHeader. // Issue 5036 on github. diff --git a/test/parallel/test-http-zero-length-write.js b/test/parallel/test-http-zero-length-write.js index b928aaeb34..b446fd7786 100644 --- a/test/parallel/test-http-zero-length-write.js +++ b/test/parallel/test-http-zero-length-write.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); -var Stream = require('stream'); +const Stream = require('stream'); function getSrc() { // An old-style readable stream. diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js index 348cf499b6..09a0f6bdd6 100644 --- a/test/parallel/test-https-agent-servername.js +++ b/test/parallel/test-https-agent-servername.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); -var fs = require('fs'); +const https = require('https'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-byteswritten.js b/test/parallel/test-https-byteswritten.js index 58dfb12dbe..51f59bc311 100644 --- a/test/parallel/test-https-byteswritten.js +++ b/test/parallel/test-https-byteswritten.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-client-checkServerIdentity.js b/test/parallel/test-https-client-checkServerIdentity.js index 053a563005..82f03320c4 100644 --- a/test/parallel/test-https-client-checkServerIdentity.js +++ b/test/parallel/test-https-client-checkServerIdentity.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); var options = { key: fs.readFileSync(path.join(common.fixturesDir, 'keys/agent3-key.pem')), diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js index 1a9fdf5f3f..4e92b6ae88 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -3,15 +3,15 @@ const common = require('../common'); // disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; -var assert = require('assert'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index b1708f24b1..32626b0a05 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); var options = { key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js index 734e806902..58a06c70e2 100644 --- a/test/parallel/test-https-client-resume.js +++ b/test/parallel/test-https-client-resume.js @@ -2,17 +2,17 @@ // Create an ssl server. First connection, validate that not resume. // Cache session and close connection. Use session on second connection. // ASSERT resumption. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var tls = require('tls'); -var fs = require('fs'); +const tls = require('tls'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), diff --git a/test/parallel/test-https-connecting-to-http.js b/test/parallel/test-https-connecting-to-http.js index 5315859505..3bfab5f626 100644 --- a/test/parallel/test-https-connecting-to-http.js +++ b/test/parallel/test-https-connecting-to-http.js @@ -1,14 +1,14 @@ 'use strict'; // This tests the situation where you try to connect a https client // to an http server. You should get an error and exit. -var common = require('../common'); -var http = require('http'); +const common = require('../common'); +const http = require('http'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); var server = http.createServer(common.fail); diff --git a/test/parallel/test-https-drain.js b/test/parallel/test-https-drain.js index 7648469b0f..0f6501e8ef 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); var options = { key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), diff --git a/test/parallel/test-https-eof-for-eom.js b/test/parallel/test-https-eof-for-eom.js index 1c814714bf..81d4e978a8 100644 --- a/test/parallel/test-https-eof-for-eom.js +++ b/test/parallel/test-https-eof-for-eom.js @@ -7,17 +7,17 @@ // This test is to be sure that the https client is handling this case // correctly. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); -var tls = require('tls'); +const https = require('https'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index 5c9fb613e6..6be850a11e 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -1,22 +1,22 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.opensslCli) { common.skip('node compiled without OpenSSL CLI.'); return; } -var assert = require('assert'); -var join = require('path').join; +const assert = require('assert'); +const join = require('path').join; -var fs = require('fs'); -var spawn = require('child_process').spawn; +const fs = require('fs'); +const spawn = require('child_process').spawn; if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); var options = { key: fs.readFileSync(common.fixturesDir + '/agent.key'), diff --git a/test/parallel/test-https-host-headers.js b/test/parallel/test-https-host-headers.js index 3e998d4704..25de4435ea 100644 --- a/test/parallel/test-https-host-headers.js +++ b/test/parallel/test-https-host-headers.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-https-localaddress-bind-error.js b/test/parallel/test-https-localaddress-bind-error.js index 91c3062a6e..2382d59a7c 100644 --- a/test/parallel/test-https-localaddress-bind-error.js +++ b/test/parallel/test-https-localaddress-bind-error.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var fs = require('fs'); +const common = require('../common'); +const fs = require('fs'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js index e6aa0c93a2..22e96eb467 100644 --- a/test/parallel/test-https-localaddress.js +++ b/test/parallel/test-https-localaddress.js @@ -7,7 +7,7 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); if (!common.hasMultiLocalhost()) { common.skip('platform-specific test.'); diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 02715de60d..8d0f51b6a5 100644 --- a/test/parallel/test-https-pfx.js +++ b/test/parallel/test-https-pfx.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); var pfx = fs.readFileSync(common.fixturesDir + '/test_cert.pfx'); diff --git a/test/parallel/test-https-req-split.js b/test/parallel/test-https-req-split.js index b49c17f288..d0d20a73ad 100644 --- a/test/parallel/test-https-req-split.js +++ b/test/parallel/test-https-req-split.js @@ -7,10 +7,10 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var tls = require('tls'); -var fs = require('fs'); +const tls = require('tls'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-resume-after-renew.js b/test/parallel/test-https-resume-after-renew.js index 0efe467932..72d7710425 100644 --- a/test/parallel/test-https-resume-after-renew.js +++ b/test/parallel/test-https-resume-after-renew.js @@ -5,9 +5,9 @@ if (!common.hasCrypto) { return; } -var fs = require('fs'); -var https = require('https'); -var crypto = require('crypto'); +const fs = require('fs'); +const https = require('https'); +const crypto = require('crypto'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-set-timeout-server.js b/test/parallel/test-https-set-timeout-server.js index fd00a521a0..fbf16a0ce3 100644 --- a/test/parallel/test-https-set-timeout-server.js +++ b/test/parallel/test-https-set-timeout-server.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var tls = require('tls'); -var fs = require('fs'); +const tls = require('tls'); +const fs = require('fs'); var tests = []; diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index 70013d1770..337cc264a2 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); +const fs = require('fs'); -var http = require('http'); +const http = require('http'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index 871d9ef94e..057d533791 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -3,16 +3,16 @@ const common = require('../common'); // disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; -var assert = require('assert'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); function file(fname) { return path.resolve(common.fixturesDir, 'keys', fname); diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js index 07b7984f2d..a17abec539 100644 --- a/test/parallel/test-https-timeout-server-2.js +++ b/test/parallel/test-https-timeout-server-2.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var tls = require('tls'); -var fs = require('fs'); +const tls = require('tls'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-internal-modules-expose.js b/test/parallel/test-internal-modules-expose.js index ed3cecb6f2..dd3a7f7a3c 100644 --- a/test/parallel/test-internal-modules-expose.js +++ b/test/parallel/test-internal-modules-expose.js @@ -2,6 +2,6 @@ // Flags: --expose_internals require('../common'); -var assert = require('assert'); +const assert = require('assert'); assert.equal(typeof require('internal/freelist').FreeList, 'function'); diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index 606109030b..001eb007f2 100644 --- a/test/parallel/test-listen-fd-cluster.js +++ b/test/parallel/test-listen-fd-cluster.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); -var cluster = require('cluster'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); +const cluster = require('cluster'); console.error('Cluster listen fd test', process.argv[2] || 'runner'); @@ -68,7 +68,7 @@ function test(cb) { const port = this.address().port; console.error('server listening on %d', port); - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var master = spawn(process.execPath, [__filename, 'master'], { stdio: [ 0, 'pipe', 2, server._handle, 'ipc' ], detached: true diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js index 5dfe346a49..9699232d2e 100644 --- a/test/parallel/test-listen-fd-detached-inherit.js +++ b/test/parallel/test-listen-fd-detached-inherit.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); +const spawn = require('child_process').spawn; if (common.isWindows) { common.skip('This test is disabled on windows.'); diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js index 0629f7ea79..4ec3654a21 100644 --- a/test/parallel/test-listen-fd-detached.js +++ b/test/parallel/test-listen-fd-detached.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); +const spawn = require('child_process').spawn; if (common.isWindows) { common.skip('This test is disabled on windows.'); @@ -66,7 +66,7 @@ function parent() { }).listen(0, function() { console.error('server listening on %d', this.address().port); - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child'], { stdio: [ 'ignore', 'ignore', 'ignore', server._handle ], detached: true diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index eda75e5c72..87a624f713 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); if (common.isWindows) { common.skip('This test is disabled on windows.'); @@ -74,7 +74,7 @@ function test(cb) { const port = this.address().port; console.error('server listening on %d', port); - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child'], { stdio: [ 0, 1, 2, server._handle, 'ipc' ] }); diff --git a/test/parallel/test-memory-usage-emfile.js b/test/parallel/test-memory-usage-emfile.js index 92c103669a..ce74dd3be3 100644 --- a/test/parallel/test-memory-usage-emfile.js +++ b/test/parallel/test-memory-usage-emfile.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var fs = require('fs'); +const fs = require('fs'); var files = []; diff --git a/test/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index c5905c537a..400e17aa00 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var r = process.memoryUsage(); assert.ok(r.rss > 0); diff --git a/test/parallel/test-microtask-queue-integration-domain.js b/test/parallel/test-microtask-queue-integration-domain.js index 1e07fa5d41..2e865041df 100644 --- a/test/parallel/test-microtask-queue-integration-domain.js +++ b/test/parallel/test-microtask-queue-integration-domain.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // Requiring the domain module here changes the function that is used by node to // call process.nextTick's callbacks to a variant that specifically handles diff --git a/test/parallel/test-microtask-queue-integration.js b/test/parallel/test-microtask-queue-integration.js index 2cc608d96a..f4f518caa3 100644 --- a/test/parallel/test-microtask-queue-integration.js +++ b/test/parallel/test-microtask-queue-integration.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var implementations = [ function(fn) { diff --git a/test/parallel/test-microtask-queue-run-domain.js b/test/parallel/test-microtask-queue-run-domain.js index fb5139f71d..57ba4543a3 100644 --- a/test/parallel/test-microtask-queue-run-domain.js +++ b/test/parallel/test-microtask-queue-run-domain.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // Requiring the domain module here changes the function that is used by node to // call process.nextTick's callbacks to a variant that specifically handles diff --git a/test/parallel/test-microtask-queue-run-immediate-domain.js b/test/parallel/test-microtask-queue-run-immediate-domain.js index 4a7729ab98..5241b6c4a9 100644 --- a/test/parallel/test-microtask-queue-run-immediate-domain.js +++ b/test/parallel/test-microtask-queue-run-immediate-domain.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // Requiring the domain module here changes the function that is used by node to // call process.nextTick's callbacks to a variant that specifically handles diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index 479062ad47..b21af670ff 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); function enqueueMicrotask(fn) { Promise.resolve().then(fn); diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index ce743d9300..3150c9ebda 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); function enqueueMicrotask(fn) { Promise.resolve().then(fn); diff --git a/test/parallel/test-module-globalpaths-nodepath.js b/test/parallel/test-module-globalpaths-nodepath.js index 3369df0676..66511e51ed 100644 --- a/test/parallel/test-module-globalpaths-nodepath.js +++ b/test/parallel/test-module-globalpaths-nodepath.js @@ -1,8 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); - -var module = require('module'); +const common = require('../common'); +const assert = require('assert'); +const mod = require('module'); var partA, partB; var partC = ''; @@ -17,10 +16,10 @@ if (common.isWindows) { process.env['NODE_PATH'] = partA + ':' + partB + ':' + partC; } -module._initPaths(); +mod._initPaths(); -assert.ok(module.globalPaths.indexOf(partA) !== -1); -assert.ok(module.globalPaths.indexOf(partB) !== -1); -assert.ok(module.globalPaths.indexOf(partC) === -1); +assert.ok(mod.globalPaths.indexOf(partA) !== -1); +assert.ok(mod.globalPaths.indexOf(partB) !== -1); +assert.ok(mod.globalPaths.indexOf(partC) === -1); -assert.ok(Array.isArray(module.globalPaths)); +assert.ok(Array.isArray(mod.globalPaths)); diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 1455309854..1958fe6524 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); console.error('load test-module-loading-error.js'); diff --git a/test/parallel/test-module-version.js b/test/parallel/test-module-version.js index 7f96e8bb60..04f011bbfa 100644 --- a/test/parallel/test-module-version.js +++ b/test/parallel/test-module-version.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // check for existence assert(process.config.variables.hasOwnProperty('node_module_version')); diff --git a/test/parallel/test-net-after-close.js b/test/parallel/test-net-after-close.js index a73663e7da..db658bcb03 100644 --- a/test/parallel/test-net-after-close.js +++ b/test/parallel/test-net-after-close.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer(function(s) { console.error('SERVER: got connection'); diff --git a/test/parallel/test-net-better-error-messages-path.js b/test/parallel/test-net-better-error-messages-path.js index 9222a1cc75..bf18e14898 100644 --- a/test/parallel/test-net-better-error-messages-path.js +++ b/test/parallel/test-net-better-error-messages-path.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var net = require('net'); -var assert = require('assert'); +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); var fp = '/tmp/fadagagsdfgsdf'; var c = net.connect(fp); diff --git a/test/parallel/test-net-bind-twice.js b/test/parallel/test-net-bind-twice.js index 9b9fc7c5db..68e93a75f0 100644 --- a/test/parallel/test-net-bind-twice.js +++ b/test/parallel/test-net-bind-twice.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server1 = net.createServer(common.fail); server1.listen(0, '127.0.0.1', common.mustCall(function() { diff --git a/test/parallel/test-net-buffersize.js b/test/parallel/test-net-buffersize.js index 872d8de7b4..dfaf5dd50d 100644 --- a/test/parallel/test-net-buffersize.js +++ b/test/parallel/test-net-buffersize.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var iter = 10; diff --git a/test/parallel/test-net-bytes-stats.js b/test/parallel/test-net-bytes-stats.js index a8643b03b9..518b2f10ba 100644 --- a/test/parallel/test-net-bytes-stats.js +++ b/test/parallel/test-net-bytes-stats.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var bytesRead = 0; var bytesWritten = 0; diff --git a/test/parallel/test-net-can-reset-timeout.js b/test/parallel/test-net-can-reset-timeout.js index 7dbd5cad2a..c5333e2522 100644 --- a/test/parallel/test-net-can-reset-timeout.js +++ b/test/parallel/test-net-can-reset-timeout.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var server = net.createServer(common.mustCall(function(stream) { stream.setTimeout(100); diff --git a/test/parallel/test-net-connect-buffer.js b/test/parallel/test-net-connect-buffer.js index 3ef5b0ea9f..187cbf1942 100644 --- a/test/parallel/test-net-connect-buffer.js +++ b/test/parallel/test-net-connect-buffer.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var dataWritten = false; var connectHappened = false; diff --git a/test/parallel/test-net-connect-options.js b/test/parallel/test-net-connect-options.js index 3446790d7b..727504b06f 100644 --- a/test/parallel/test-net-connect-options.js +++ b/test/parallel/test-net-connect-options.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer({ allowHalfOpen: true diff --git a/test/parallel/test-net-connect-paused-connection.js b/test/parallel/test-net-connect-paused-connection.js index 8c0e1c93cf..a0a90eefc1 100644 --- a/test/parallel/test-net-connect-paused-connection.js +++ b/test/parallel/test-net-connect-paused-connection.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); net.createServer(function(conn) { conn.unref(); diff --git a/test/parallel/test-net-dns-custom-lookup.js b/test/parallel/test-net-dns-custom-lookup.js index 07eb71c5ed..d643910d62 100644 --- a/test/parallel/test-net-dns-custom-lookup.js +++ b/test/parallel/test-net-dns-custom-lookup.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); function check(addressType, cb) { var server = net.createServer(function(client) { diff --git a/test/parallel/test-net-dns-error.js b/test/parallel/test-net-dns-error.js index b36d84d3e9..f5a1dcc6b1 100644 --- a/test/parallel/test-net-dns-error.js +++ b/test/parallel/test-net-dns-error.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var net = require('net'); +const net = require('net'); var host = '*'.repeat(256); diff --git a/test/parallel/test-net-dns-lookup-skip.js b/test/parallel/test-net-dns-lookup-skip.js index 513a6d0422..60674053f7 100644 --- a/test/parallel/test-net-dns-lookup-skip.js +++ b/test/parallel/test-net-dns-lookup-skip.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var net = require('net'); +const common = require('../common'); +const net = require('net'); function check(addressType) { var server = net.createServer(function(client) { diff --git a/test/parallel/test-net-dns-lookup.js b/test/parallel/test-net-dns-lookup.js index 4f3cd2991c..c0aebf0ee9 100644 --- a/test/parallel/test-net-dns-lookup.js +++ b/test/parallel/test-net-dns-lookup.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer(function(client) { client.end(); diff --git a/test/parallel/test-net-during-close.js b/test/parallel/test-net-during-close.js index 2649995f89..f6a5455ee7 100644 --- a/test/parallel/test-net-during-close.js +++ b/test/parallel/test-net-during-close.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer(function(socket) { socket.end(); diff --git a/test/parallel/test-net-eaddrinuse.js b/test/parallel/test-net-eaddrinuse.js index 4741c82079..53ae1a0589 100644 --- a/test/parallel/test-net-eaddrinuse.js +++ b/test/parallel/test-net-eaddrinuse.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server1 = net.createServer(function(socket) { }); diff --git a/test/parallel/test-net-end-without-connect.js b/test/parallel/test-net-end-without-connect.js index 69abf48631..0bbd283362 100644 --- a/test/parallel/test-net-end-without-connect.js +++ b/test/parallel/test-net-end-without-connect.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var net = require('net'); +const net = require('net'); var sock = new net.Socket(); sock.end(); // Should not throw. diff --git a/test/parallel/test-net-isip.js b/test/parallel/test-net-isip.js index 6b159b59d8..65d88523fe 100644 --- a/test/parallel/test-net-isip.js +++ b/test/parallel/test-net-isip.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); assert.equal(net.isIP('127.0.0.1'), 4); assert.equal(net.isIP('x127.0.0.1'), 0); diff --git a/test/parallel/test-net-large-string.js b/test/parallel/test-net-large-string.js index b469b02895..ba70275eb0 100644 --- a/test/parallel/test-net-large-string.js +++ b/test/parallel/test-net-large-string.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var kPoolSize = 40 * 1024; var data = 'あ'.repeat(kPoolSize); diff --git a/test/parallel/test-net-listen-close-server-callback-is-not-function.js b/test/parallel/test-net-listen-close-server-callback-is-not-function.js index 03c08d4f51..18234a816e 100644 --- a/test/parallel/test-net-listen-close-server-callback-is-not-function.js +++ b/test/parallel/test-net-listen-close-server-callback-is-not-function.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var server = net.createServer(common.fail); diff --git a/test/parallel/test-net-listen-close-server.js b/test/parallel/test-net-listen-close-server.js index 92c7274f32..b6ab99c60e 100644 --- a/test/parallel/test-net-listen-close-server.js +++ b/test/parallel/test-net-listen-close-server.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var server = net.createServer(function(socket) { }); diff --git a/test/parallel/test-net-listen-error.js b/test/parallel/test-net-listen-error.js index 9523fcb2e7..009d12b09e 100644 --- a/test/parallel/test-net-listen-error.js +++ b/test/parallel/test-net-listen-error.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var server = net.createServer(function(socket) { }); diff --git a/test/parallel/test-net-listen-exclusive-random-ports.js b/test/parallel/test-net-listen-exclusive-random-ports.js index f46f9a01d7..4c5d056d9d 100644 --- a/test/parallel/test-net-listen-exclusive-random-ports.js +++ b/test/parallel/test-net-listen-exclusive-random-ports.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); function noop() {} diff --git a/test/parallel/test-net-listen-shared-ports.js b/test/parallel/test-net-listen-shared-ports.js index 2062dd0ce1..4cd26ac330 100644 --- a/test/parallel/test-net-listen-shared-ports.js +++ b/test/parallel/test-net-listen-shared-ports.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); function noop() {} diff --git a/test/parallel/test-net-localport.js b/test/parallel/test-net-localport.js index 4af9dcfd08..3c105ff287 100644 --- a/test/parallel/test-net-localport.js +++ b/test/parallel/test-net-localport.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer(function(socket) { console.log(socket.remotePort); diff --git a/test/parallel/test-net-persistent-keepalive.js b/test/parallel/test-net-persistent-keepalive.js index d1dfb37016..febdc68851 100644 --- a/test/parallel/test-net-persistent-keepalive.js +++ b/test/parallel/test-net-persistent-keepalive.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var serverConnection; var clientConnection; diff --git a/test/parallel/test-net-persistent-nodelay.js b/test/parallel/test-net-persistent-nodelay.js index e23b8718df..bd34d30326 100644 --- a/test/parallel/test-net-persistent-nodelay.js +++ b/test/parallel/test-net-persistent-nodelay.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var TCPWrap = process.binding('tcp_wrap').TCP; var echoServer = net.createServer(function(connection) { diff --git a/test/parallel/test-net-persistent-ref-unref.js b/test/parallel/test-net-persistent-ref-unref.js index 32782e7c59..9034a16f9a 100644 --- a/test/parallel/test-net-persistent-ref-unref.js +++ b/test/parallel/test-net-persistent-ref-unref.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var TCPWrap = process.binding('tcp_wrap').TCP; var echoServer = net.createServer(function(conn) { diff --git a/test/parallel/test-net-reconnect.js b/test/parallel/test-net-reconnect.js index 980de2637b..c0c5589b39 100644 --- a/test/parallel/test-net-reconnect.js +++ b/test/parallel/test-net-reconnect.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var net = require('net'); +const net = require('net'); var N = 50; var client_recv_count = 0; diff --git a/test/parallel/test-net-server-bind.js b/test/parallel/test-net-server-bind.js index c77341418c..623962e3ab 100644 --- a/test/parallel/test-net-server-bind.js +++ b/test/parallel/test-net-server-bind.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); // With only a callback, server should get a port assigned by the OS diff --git a/test/parallel/test-net-server-close.js b/test/parallel/test-net-server-close.js index 006ca529c7..9f920a6a69 100644 --- a/test/parallel/test-net-server-close.js +++ b/test/parallel/test-net-server-close.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var events = []; var sockets = []; diff --git a/test/parallel/test-net-server-connections.js b/test/parallel/test-net-server-connections.js index ae89d9aac7..ce3087713c 100644 --- a/test/parallel/test-net-server-connections.js +++ b/test/parallel/test-net-server-connections.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var net = require('net'); +const net = require('net'); // test that server.connections property is no longer enumerable now that it // has been marked as deprecated diff --git a/test/parallel/test-net-server-listen-remove-callback.js b/test/parallel/test-net-server-listen-remove-callback.js index 9bdfd62807..4d2c12102c 100644 --- a/test/parallel/test-net-server-listen-remove-callback.js +++ b/test/parallel/test-net-server-listen-remove-callback.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); // Server should only fire listen callback once var server = net.createServer(); diff --git a/test/parallel/test-net-server-max-connections-close-makes-more-available.js b/test/parallel/test-net-server-max-connections-close-makes-more-available.js index fb9831d05b..14a27da8f8 100644 --- a/test/parallel/test-net-server-max-connections-close-makes-more-available.js +++ b/test/parallel/test-net-server-max-connections-close-makes-more-available.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var net = require('net'); +const net = require('net'); // Sets the server's maxConnections property to 1. // Open 2 connections (connection 0 and connection 1). diff --git a/test/parallel/test-net-server-unref-persistent.js b/test/parallel/test-net-server-unref-persistent.js index d68e94cfbd..e75a4d8305 100644 --- a/test/parallel/test-net-server-unref-persistent.js +++ b/test/parallel/test-net-server-unref-persistent.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var server = net.createServer(); // unref before listening diff --git a/test/parallel/test-net-server-unref.js b/test/parallel/test-net-server-unref.js index 91b25887a2..bf8a9ef43a 100644 --- a/test/parallel/test-net-server-unref.js +++ b/test/parallel/test-net-server-unref.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var s = net.createServer(); s.listen(0); diff --git a/test/parallel/test-net-socket-destroy-twice.js b/test/parallel/test-net-socket-destroy-twice.js index 917e984999..be82d9f2a6 100644 --- a/test/parallel/test-net-socket-destroy-twice.js +++ b/test/parallel/test-net-socket-destroy-twice.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var net = require('net'); +const common = require('../common'); +const net = require('net'); var conn = net.createConnection(common.PORT); diff --git a/test/parallel/test-net-stream.js b/test/parallel/test-net-stream.js index d090038ce7..12fcc25b0a 100644 --- a/test/parallel/test-net-stream.js +++ b/test/parallel/test-net-stream.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var s = new net.Stream(); diff --git a/test/parallel/test-net-write-after-close.js b/test/parallel/test-net-write-after-close.js index e01aef80f3..d8213a9b86 100644 --- a/test/parallel/test-net-write-after-close.js +++ b/test/parallel/test-net-write-after-close.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var net = require('net'); +const net = require('net'); var server = net.createServer(common.mustCall(function(socket) { socket.resume(); diff --git a/test/parallel/test-net-write-connect-write.js b/test/parallel/test-net-write-connect-write.js index 315db6bc02..15a30b826e 100644 --- a/test/parallel/test-net-write-connect-write.js +++ b/test/parallel/test-net-write-connect-write.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer(function(socket) { socket.pipe(socket); diff --git a/test/parallel/test-net-write-slow.js b/test/parallel/test-net-write-slow.js index 6054e2b788..7e183068f1 100644 --- a/test/parallel/test-net-write-slow.js +++ b/test/parallel/test-net-write-slow.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); var SIZE = 2E5; var N = 10; diff --git a/test/parallel/test-next-tick-domain.js b/test/parallel/test-next-tick-domain.js index 8f9d9bb4aa..634e311da7 100644 --- a/test/parallel/test-next-tick-domain.js +++ b/test/parallel/test-next-tick-domain.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var origNextTick = process.nextTick; diff --git a/test/parallel/test-next-tick-errors.js b/test/parallel/test-next-tick-errors.js index 180b769eaa..4f47c3f954 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); const order = []; let exceptionHandled = false; diff --git a/test/parallel/test-next-tick-intentional-starvation.js b/test/parallel/test-next-tick-intentional-starvation.js index 414524e540..3da32b8ffa 100644 --- a/test/parallel/test-next-tick-intentional-starvation.js +++ b/test/parallel/test-next-tick-intentional-starvation.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // this is the inverse of test-next-tick-starvation. // it verifies that process.nextTick will *always* come before other diff --git a/test/parallel/test-next-tick-ordering.js b/test/parallel/test-next-tick-ordering.js index 63f8d37828..316fdb9f9a 100644 --- a/test/parallel/test-next-tick-ordering.js +++ b/test/parallel/test-next-tick-ordering.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var i; var N = 30; diff --git a/test/parallel/test-next-tick-ordering2.js b/test/parallel/test-next-tick-ordering2.js index 11ac84b531..32c5bd8e8e 100644 --- a/test/parallel/test-next-tick-ordering2.js +++ b/test/parallel/test-next-tick-ordering2.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var order = []; process.nextTick(function() { diff --git a/test/parallel/test-next-tick.js b/test/parallel/test-next-tick.js index 2a98b46da1..702d2308ae 100644 --- a/test/parallel/test-next-tick.js +++ b/test/parallel/test-next-tick.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); process.nextTick(common.mustCall(function() { process.nextTick(common.mustCall(function() { diff --git a/test/parallel/test-path-makelong.js b/test/parallel/test-path-makelong.js index 50a77e9d87..9d3c3852cd 100644 --- a/test/parallel/test-path-makelong.js +++ b/test/parallel/test-path-makelong.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var path = require('path'); +const assert = require('assert'); +const path = require('path'); if (common.isWindows) { var file = path.join(common.fixturesDir, 'a.js'); diff --git a/test/parallel/test-pipe-address.js b/test/parallel/test-pipe-address.js index 85e3daa352..d4bb0ffbc5 100644 --- a/test/parallel/test-pipe-address.js +++ b/test/parallel/test-pipe-address.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); var server = net.createServer(common.fail); common.refreshTmpDir(); diff --git a/test/parallel/test-pipe-return-val.js b/test/parallel/test-pipe-return-val.js index a14f925916..a5f2ff6dfa 100644 --- a/test/parallel/test-pipe-return-val.js +++ b/test/parallel/test-pipe-return-val.js @@ -2,8 +2,8 @@ // This test ensures SourceStream.pipe(DestStream) returns DestStream require('../common'); -var Stream = require('stream').Stream; -var assert = require('assert'); +const Stream = require('stream').Stream; +const assert = require('assert'); var sourceStream = new Stream(); var destStream = new Stream(); diff --git a/test/parallel/test-pipe-stream.js b/test/parallel/test-pipe-stream.js index 6298495087..8392c80110 100644 --- a/test/parallel/test-pipe-stream.js +++ b/test/parallel/test-pipe-stream.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); common.refreshTmpDir(); diff --git a/test/parallel/test-pipe-unref.js b/test/parallel/test-pipe-unref.js index 35c25524b4..f926dab3e5 100644 --- a/test/parallel/test-pipe-unref.js +++ b/test/parallel/test-pipe-unref.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var net = require('net'); +const common = require('../common'); +const net = require('net'); common.refreshTmpDir(); diff --git a/test/parallel/test-process-argv-0.js b/test/parallel/test-process-argv-0.js index c3aacb60fa..ad078d02b4 100644 --- a/test/parallel/test-process-argv-0.js +++ b/test/parallel/test-process-argv-0.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var path = require('path'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const path = require('path'); +const assert = require('assert'); +const spawn = require('child_process').spawn; if (process.argv[2] !== 'child') { var child = spawn(process.execPath, [__filename, 'child'], { diff --git a/test/parallel/test-process-before-exit.js b/test/parallel/test-process-before-exit.js index 5d8855869a..01590de0fc 100644 --- a/test/parallel/test-process-before-exit.js +++ b/test/parallel/test-process-before-exit.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var N = 5; var n = 0; diff --git a/test/parallel/test-process-binding.js b/test/parallel/test-process-binding.js index 722e9333af..475891aa5d 100644 --- a/test/parallel/test-process-binding.js +++ b/test/parallel/test-process-binding.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); assert.throws( function() { diff --git a/test/parallel/test-process-config.js b/test/parallel/test-process-config.js index ab38a48e5a..e692a7bf19 100644 --- a/test/parallel/test-process-config.js +++ b/test/parallel/test-process-config.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); // check for existence assert(process.hasOwnProperty('config')); diff --git a/test/parallel/test-process-exec-argv.js b/test/parallel/test-process-exec-argv.js index e32971ae81..c7de82adae 100644 --- a/test/parallel/test-process-exec-argv.js +++ b/test/parallel/test-process-exec-argv.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const assert = require('assert'); +const spawn = require('child_process').spawn; if (process.argv[2] === 'child') { process.stdout.write(JSON.stringify(process.execArgv)); diff --git a/test/parallel/test-process-exit-code.js b/test/parallel/test-process-exit-code.js index 8d657528d0..b93ae443a7 100644 --- a/test/parallel/test-process-exit-code.js +++ b/test/parallel/test-process-exit-code.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); switch (process.argv[2]) { case 'child1': @@ -70,7 +70,7 @@ function parent() { } function test(arg, exit) { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var node = process.execPath; var f = __filename; var option = { stdio: [ 0, 1, 'ignore' ] }; diff --git a/test/parallel/test-process-exit-from-before-exit.js b/test/parallel/test-process-exit-from-before-exit.js index b37df0a5bd..82458217c6 100644 --- a/test/parallel/test-process-exit-from-before-exit.js +++ b/test/parallel/test-process-exit-from-before-exit.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); process.on('beforeExit', common.mustCall(function() { setTimeout(common.fail, 5); diff --git a/test/parallel/test-process-exit-recursive.js b/test/parallel/test-process-exit-recursive.js index 53426a6b1c..252b282b04 100644 --- a/test/parallel/test-process-exit-recursive.js +++ b/test/parallel/test-process-exit-recursive.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // recursively calling .exit() should not overflow the call stack var nexits = 0; diff --git a/test/parallel/test-process-exit.js b/test/parallel/test-process-exit.js index 0ea36f158e..9d48ea9eac 100644 --- a/test/parallel/test-process-exit.js +++ b/test/parallel/test-process-exit.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // calling .exit() from within "exit" should not overflow the call stack var nexits = 0; diff --git a/test/parallel/test-process-getgroups.js b/test/parallel/test-process-getgroups.js index 1e1bd01696..9e08892b62 100644 --- a/test/parallel/test-process-getgroups.js +++ b/test/parallel/test-process-getgroups.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var exec = require('child_process').exec; +const assert = require('assert'); +const exec = require('child_process').exec; if (common.isOSX) { common.skip('Output of `id -G` is unreliable on Darwin.'); diff --git a/test/parallel/test-process-hrtime.js b/test/parallel/test-process-hrtime.js index db16be0ad9..1b5940823a 100644 --- a/test/parallel/test-process-hrtime.js +++ b/test/parallel/test-process-hrtime.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // the default behavior, return an Array "tuple" of numbers var tuple = process.hrtime(); diff --git a/test/parallel/test-process-kill-null.js b/test/parallel/test-process-kill-null.js index 2516773f08..406b294362 100644 --- a/test/parallel/test-process-kill-null.js +++ b/test/parallel/test-process-kill-null.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const assert = require('assert'); +const spawn = require('child_process').spawn; var cat = spawn('cat'); var called; diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index ee0554c320..9b4a5fa47a 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // test variants of pid // diff --git a/test/parallel/test-process-raw-debug.js b/test/parallel/test-process-raw-debug.js index ab46190291..41774cb87a 100644 --- a/test/parallel/test-process-raw-debug.js +++ b/test/parallel/test-process-raw-debug.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var os = require('os'); +const assert = require('assert'); +const os = require('os'); switch (process.argv[2]) { case 'child': @@ -13,7 +13,7 @@ switch (process.argv[2]) { } function parent() { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child']); var output = ''; diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js index b5d4dc35e4..08e1b152ed 100644 --- a/test/parallel/test-process-wrap.js +++ b/test/parallel/test-process-wrap.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var Process = process.binding('process_wrap').Process; var Pipe = process.binding('pipe_wrap').Pipe; var pipe = new Pipe(); diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js index b827dd9e36..e275dac238 100644 --- a/test/parallel/test-promises-unhandled-rejections.js +++ b/test/parallel/test-promises-unhandled-rejections.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var domain = require('domain'); +const common = require('../common'); +const assert = require('assert'); +const domain = require('domain'); var asyncTest = (function() { var asyncTestsEnabled = false; diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index 37cf66705d..9f1e715eb9 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -1,9 +1,9 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // test using assert -var qs = require('querystring'); +const qs = require('querystring'); function createWithNoPrototype(properties) { const noProto = Object.create(null); @@ -87,7 +87,7 @@ var qsWeirdObjects = [ ]; // }}} -var vm = require('vm'); +const vm = require('vm'); var foreignObject = vm.runInNewContext('({"foo": ["bar", "baz"]})'); var qsNoMungeTestCases = [ diff --git a/test/parallel/test-readline-keys.js b/test/parallel/test-readline-keys.js index 6bbbb2e918..eae4ba55b7 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var PassThrough = require('stream').PassThrough; -var assert = require('assert'); -var inherits = require('util').inherits; -var extend = require('util')._extend; -var Interface = require('readline').Interface; +const PassThrough = require('stream').PassThrough; +const assert = require('assert'); +const inherits = require('util').inherits; +const extend = require('util')._extend; +const Interface = require('readline').Interface; function FakeInput() { diff --git a/test/parallel/test-readline-set-raw-mode.js b/test/parallel/test-readline-set-raw-mode.js index acf0dc44a6..e9e0ff4b4d 100644 --- a/test/parallel/test-readline-set-raw-mode.js +++ b/test/parallel/test-readline-set-raw-mode.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var readline = require('readline'); -var Stream = require('stream'); +const assert = require('assert'); +const readline = require('readline'); +const Stream = require('stream'); var stream = new Stream(); var expectedRawMode = true; diff --git a/test/parallel/test-ref-unref-return.js b/test/parallel/test-ref-unref-return.js index 89ac52d2bc..aec2fff5ce 100644 --- a/test/parallel/test-ref-unref-return.js +++ b/test/parallel/test-ref-unref-return.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var net = require('net'); -var dgram = require('dgram'); +const assert = require('assert'); +const net = require('net'); +const dgram = require('dgram'); assert.ok((new net.Server()).ref() instanceof net.Server); assert.ok((new net.Server()).unref() instanceof net.Server); diff --git a/test/parallel/test-regress-GH-1531.js b/test/parallel/test-regress-GH-1531.js index fa0781c2e2..0ca1186d01 100644 --- a/test/parallel/test-regress-GH-1531.js +++ b/test/parallel/test-regress-GH-1531.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-regress-GH-1899.js b/test/parallel/test-regress-GH-1899.js index 7ce83e0009..1c98b30a8d 100644 --- a/test/parallel/test-regress-GH-1899.js +++ b/test/parallel/test-regress-GH-1899.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var path = require('path'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const path = require('path'); +const assert = require('assert'); +const spawn = require('child_process').spawn; var child = spawn(process.argv[0], [ path.join(common.fixturesDir, 'GH-1899-output.js') diff --git a/test/parallel/test-regress-GH-2245.js b/test/parallel/test-regress-GH-2245.js index 7558529f9f..129b1428d3 100644 --- a/test/parallel/test-regress-GH-2245.js +++ b/test/parallel/test-regress-GH-2245.js @@ -1,6 +1,6 @@ /* eslint-disable strict */ require('../common'); -var assert = require('assert'); +const assert = require('assert'); /* In Node.js 0.10, a bug existed that caused strict functions to not capture diff --git a/test/parallel/test-regress-GH-4948.js b/test/parallel/test-regress-GH-4948.js index 0317778787..69f4e47324 100644 --- a/test/parallel/test-regress-GH-4948.js +++ b/test/parallel/test-regress-GH-4948.js @@ -2,7 +2,7 @@ // https://github.com/joyent/node/issues/4948 require('../common'); -var http = require('http'); +const http = require('http'); var reqCount = 0; var server = http.createServer(function(serverReq, serverRes) { @@ -31,7 +31,7 @@ var server = http.createServer(function(serverReq, serverRes) { serverRes.write('some data'); }).listen(0, function() { // simulate a client request that closes early - var net = require('net'); + const net = require('net'); var sock = new net.Socket(); sock.connect(this.address().port, 'localhost'); diff --git a/test/parallel/test-regress-GH-5927.js b/test/parallel/test-regress-GH-5927.js index a23c947c32..779a2c2c64 100644 --- a/test/parallel/test-regress-GH-5927.js +++ b/test/parallel/test-regress-GH-5927.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var readline = require('readline'); +const assert = require('assert'); +const readline = require('readline'); var rl = readline.createInterface(process.stdin, process.stdout); rl.resume(); diff --git a/test/parallel/test-regress-GH-6235.js b/test/parallel/test-regress-GH-6235.js index 0bf9b8965d..1009288467 100644 --- a/test/parallel/test-regress-GH-6235.js +++ b/test/parallel/test-regress-GH-6235.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); assert.doesNotThrow(function() { require('vm').runInNewContext('"use strict"; var v = 1; v = 2'); diff --git a/test/parallel/test-regress-GH-746.js b/test/parallel/test-regress-GH-746.js index 8bfcb0c3e2..a5e0d9d447 100644 --- a/test/parallel/test-regress-GH-746.js +++ b/test/parallel/test-regress-GH-746.js @@ -3,7 +3,7 @@ // This is a regression test for GH-746. const common = require('../common'); -var net = require('net'); +const net = require('net'); process.stdin.destroy(); diff --git a/test/parallel/test-regress-GH-819.js b/test/parallel/test-regress-GH-819.js index 20ca75c793..bc2201b614 100644 --- a/test/parallel/test-regress-GH-819.js +++ b/test/parallel/test-regress-GH-819.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var net = require('net'); +const net = require('net'); // Connect to something that we need to DNS resolve var c = net.createConnection(80, 'google.com'); diff --git a/test/parallel/test-regress-GH-node-9326.js b/test/parallel/test-regress-GH-node-9326.js index bb55050d2c..920a24e3a1 100644 --- a/test/parallel/test-regress-GH-node-9326.js +++ b/test/parallel/test-regress-GH-node-9326.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var child_process = require('child_process'); +const assert = require('assert'); +const child_process = require('child_process'); // NOTE: Was crashing on FreeBSD var cp = child_process.spawn(process.execPath, [ diff --git a/test/parallel/test-repl-.save.load.js b/test/parallel/test-repl-.save.load.js index 247f359e82..98417e0d06 100644 --- a/test/parallel/test-repl-.save.load.js +++ b/test/parallel/test-repl-.save.load.js @@ -1,12 +1,12 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var join = require('path').join; -var fs = require('fs'); +const assert = require('assert'); +const join = require('path').join; +const fs = require('fs'); common.refreshTmpDir(); -var repl = require('repl'); +const repl = require('repl'); var works = [['inner.one'], 'inner.o']; diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index 15f779d3b1..3cc2ba4aa5 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var util = require('util'); -var repl = require('repl'); +const assert = require('assert'); +const util = require('util'); +const repl = require('repl'); // This test adds global variables common.globalCheck = false; diff --git a/test/parallel/test-repl-domain.js b/test/parallel/test-repl-domain.js index 3cc88b75f7..19c85980cd 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); -var repl = require('repl'); +const repl = require('repl'); const putIn = new common.ArrayStream(); repl.start('', putIn); diff --git a/test/parallel/test-repl-harmony.js b/test/parallel/test-repl-harmony.js index a592880038..b3e25e62ab 100644 --- a/test/parallel/test-repl-harmony.js +++ b/test/parallel/test-repl-harmony.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; var args = ['-i']; var child = spawn(process.execPath, args); diff --git a/test/parallel/test-repl-syntax-error-handling.js b/test/parallel/test-repl-syntax-error-handling.js index 10166b4f06..2728ffdfe9 100644 --- a/test/parallel/test-repl-syntax-error-handling.js +++ b/test/parallel/test-repl-syntax-error-handling.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); switch (process.argv[2]) { case 'child': @@ -12,7 +12,7 @@ switch (process.argv[2]) { } function parent() { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child']); child.stderr.setEncoding('utf8'); @@ -38,7 +38,7 @@ function parent() { } function child() { - var vm = require('vm'); + const vm = require('vm'); try { vm.runInThisContext('haf!@##&$!@$*!@', { displayErrors: false }); } catch (er) { diff --git a/test/parallel/test-repl-tab.js b/test/parallel/test-repl-tab.js index c075b8d4f1..b41f43c667 100644 --- a/test/parallel/test-repl-tab.js +++ b/test/parallel/test-repl-tab.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var repl = require('repl'); -var zlib = require('zlib'); +const assert = require('assert'); +const repl = require('repl'); +const zlib = require('zlib'); // just use builtin stream inherited from Duplex var putIn = zlib.createGzip(); diff --git a/test/parallel/test-repl-unexpected-token-recoverable.js b/test/parallel/test-repl-unexpected-token-recoverable.js index 84668c8657..7ace511d09 100644 --- a/test/parallel/test-repl-unexpected-token-recoverable.js +++ b/test/parallel/test-repl-unexpected-token-recoverable.js @@ -3,9 +3,9 @@ * This is a regression test for https://github.com/joyent/node/issues/8874. */ require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; // use -i to force node into interactive mode, despite stdout not being a TTY var args = [ '-i' ]; var child = spawn(process.execPath, args); diff --git a/test/parallel/test-require-cache.js b/test/parallel/test-require-cache.js index 247590197d..437dd80e58 100644 --- a/test/parallel/test-require-cache.js +++ b/test/parallel/test-require-cache.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); { const relativePath = '../fixtures/semicolon'; diff --git a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js index 1837a17bab..0a80a86038 100644 --- a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js +++ b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js @@ -1,9 +1,9 @@ /* eslint-disable max-len */ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var content = require(common.fixturesDir + +const content = require(common.fixturesDir + '/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'); assert.notEqual(content.rocko, 'artischocko'); diff --git a/test/parallel/test-require-process.js b/test/parallel/test-require-process.js index 4e5821add1..f2a3ac89a8 100644 --- a/test/parallel/test-require-process.js +++ b/test/parallel/test-require-process.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var nativeProcess = require('process'); +const nativeProcess = require('process'); assert.strictEqual(nativeProcess, process, 'require("process") should return global process reference'); diff --git a/test/parallel/test-sigint-infinite-loop.js b/test/parallel/test-sigint-infinite-loop.js index ecd64802ac..aafcd9e41d 100644 --- a/test/parallel/test-sigint-infinite-loop.js +++ b/test/parallel/test-sigint-infinite-loop.js @@ -3,8 +3,8 @@ // Ref(http): // groups.google.com/group/nodejs-dev/browse_thread/thread/e20f2f8df0296d3f const common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const assert = require('assert'); +const spawn = require('child_process').spawn; console.log('start'); diff --git a/test/parallel/test-signal-safety.js b/test/parallel/test-signal-safety.js index 7938ae04d6..eb29554b8b 100644 --- a/test/parallel/test-signal-safety.js +++ b/test/parallel/test-signal-safety.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var Signal = process.binding('signal_wrap').Signal; // Test Signal `this` safety diff --git a/test/parallel/test-socket-write-after-fin-error.js b/test/parallel/test-socket-write-after-fin-error.js index 480d5d2edc..8ceb0c6558 100644 --- a/test/parallel/test-socket-write-after-fin-error.js +++ b/test/parallel/test-socket-write-after-fin-error.js @@ -1,13 +1,13 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // This is similar to simple/test-socket-write-after-fin, except that // we don't set allowHalfOpen. Then we write after the client has sent // a FIN, and this is an error. However, the standard "write after end" // message is too vague, and doesn't actually tell you what happens. -var net = require('net'); +const net = require('net'); var serverData = ''; var gotServerEnd = false; var clientData = ''; diff --git a/test/parallel/test-socket-write-after-fin.js b/test/parallel/test-socket-write-after-fin.js index 70f0d9bf84..17847f9733 100644 --- a/test/parallel/test-socket-write-after-fin.js +++ b/test/parallel/test-socket-write-after-fin.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const assert = require('assert'); +const net = require('net'); const expected = 'hello1hello2hello3\nTHUNDERMUSCLE!'; var server = net.createServer({ diff --git a/test/parallel/test-stdin-pipe-resume.js b/test/parallel/test-stdin-pipe-resume.js index cb28807045..663649134f 100644 --- a/test/parallel/test-stdin-pipe-resume.js +++ b/test/parallel/test-stdin-pipe-resume.js @@ -1,12 +1,12 @@ 'use strict'; // This tests that piping stdin will cause it to resume() as well. require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (process.argv[2] === 'child') { process.stdin.pipe(process.stdout); } else { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var buffers = []; var child = spawn(process.execPath, [__filename, 'child']); child.stdout.on('data', function(c) { diff --git a/test/parallel/test-stdio-readable-writable.js b/test/parallel/test-stdio-readable-writable.js index 7b9b69d309..0bc7fe269b 100644 --- a/test/parallel/test-stdio-readable-writable.js +++ b/test/parallel/test-stdio-readable-writable.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); assert(process.stdout.writable); assert(!process.stdout.readable); diff --git a/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js b/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js index a138108fae..bfc7a1ddf4 100644 --- a/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js +++ b/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (process.argv[2] === 'child') process.stdout.end('foo'); @@ -8,7 +8,7 @@ else parent(); function parent() { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child']); var out = ''; var err = ''; diff --git a/test/parallel/test-stdout-stderr-reading.js b/test/parallel/test-stdout-stderr-reading.js index e154d41b6b..b61edf194f 100644 --- a/test/parallel/test-stdout-stderr-reading.js +++ b/test/parallel/test-stdout-stderr-reading.js @@ -1,9 +1,9 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); // verify that stdout is never read from. -var net = require('net'); +const net = require('net'); var read = net.Socket.prototype.read; net.Socket.prototype.read = function() { @@ -20,7 +20,7 @@ else parent(); function parent() { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var node = process.execPath; var c1 = spawn(node, [__filename, 'child']); diff --git a/test/parallel/test-stream-pipe-event.js b/test/parallel/test-stream-pipe-event.js index d8601dd04a..77cd5d26f9 100644 --- a/test/parallel/test-stream-pipe-event.js +++ b/test/parallel/test-stream-pipe-event.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var stream = require('stream'); -var assert = require('assert'); -var util = require('util'); +const stream = require('stream'); +const assert = require('assert'); +const util = require('util'); function Writable() { this.writable = true; diff --git a/test/parallel/test-stream-push-order.js b/test/parallel/test-stream-push-order.js index 22a3156f62..4be2ca4a9f 100644 --- a/test/parallel/test-stream-push-order.js +++ b/test/parallel/test-stream-push-order.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var Readable = require('stream').Readable; -var assert = require('assert'); +const Readable = require('stream').Readable; +const assert = require('assert'); var s = new Readable({ highWaterMark: 20, diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index a5ebe4d3e9..85f5a6bf27 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -1,9 +1,9 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Readable = require('stream').Readable; -var util = require('util'); +const Readable = require('stream').Readable; +const util = require('util'); util.inherits(MyStream, Readable); function MyStream(options) { diff --git a/test/parallel/test-stream-readable-constructor-set-methods.js b/test/parallel/test-stream-readable-constructor-set-methods.js index fb2114f44d..86fab5ae54 100644 --- a/test/parallel/test-stream-readable-constructor-set-methods.js +++ b/test/parallel/test-stream-readable-constructor-set-methods.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; var _readCalled = false; function _read(n) { diff --git a/test/parallel/test-stream-readable-flow-recursion.js b/test/parallel/test-stream-readable-flow-recursion.js index 0c0b16e8f5..48615ed0a9 100644 --- a/test/parallel/test-stream-readable-flow-recursion.js +++ b/test/parallel/test-stream-readable-flow-recursion.js @@ -1,13 +1,13 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // this test verifies that passing a huge number to read(size) // will push up the highWaterMark, and cause the stream to read // more data continuously, but without triggering a nextTick // warning or RangeError. -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; // throw an error if we trigger a nextTick warning. process.throwDeprecation = true; diff --git a/test/parallel/test-stream-transform-constructor-set-methods.js b/test/parallel/test-stream-transform-constructor-set-methods.js index 720357a01b..c57a633c55 100644 --- a/test/parallel/test-stream-transform-constructor-set-methods.js +++ b/test/parallel/test-stream-transform-constructor-set-methods.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Transform = require('stream').Transform; +const Transform = require('stream').Transform; var _transformCalled = false; function _transform(d, e, n) { diff --git a/test/parallel/test-stream-transform-objectmode-falsey-value.js b/test/parallel/test-stream-transform-objectmode-falsey-value.js index 429cc1c960..c2c3886506 100644 --- a/test/parallel/test-stream-transform-objectmode-falsey-value.js +++ b/test/parallel/test-stream-transform-objectmode-falsey-value.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var stream = require('stream'); +const stream = require('stream'); var PassThrough = stream.PassThrough; var src = new PassThrough({ objectMode: true }); diff --git a/test/parallel/test-stream-transform-split-objectmode.js b/test/parallel/test-stream-transform-split-objectmode.js index 610f234bea..10fae6573c 100644 --- a/test/parallel/test-stream-transform-split-objectmode.js +++ b/test/parallel/test-stream-transform-split-objectmode.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Transform = require('stream').Transform; +const Transform = require('stream').Transform; var parser = new Transform({ readableObjectMode: true }); diff --git a/test/parallel/test-stream-unshift-empty-chunk.js b/test/parallel/test-stream-unshift-empty-chunk.js index 477f5c4be5..196a36e7eb 100644 --- a/test/parallel/test-stream-unshift-empty-chunk.js +++ b/test/parallel/test-stream-unshift-empty-chunk.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // This test verifies that stream.unshift(Buffer.alloc(0)) or // stream.unshift('') does not set state.reading=false. -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; var r = new Readable(); var nChunks = 10; diff --git a/test/parallel/test-stream-writable-change-default-encoding.js b/test/parallel/test-stream-writable-change-default-encoding.js index d1d4af5b82..9d527fa9c5 100644 --- a/test/parallel/test-stream-writable-change-default-encoding.js +++ b/test/parallel/test-stream-writable-change-default-encoding.js @@ -1,9 +1,9 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var stream = require('stream'); -var util = require('util'); +const stream = require('stream'); +const util = require('util'); function MyWritable(fn, options) { stream.Writable.call(this, options); diff --git a/test/parallel/test-stream-writable-constructor-set-methods.js b/test/parallel/test-stream-writable-constructor-set-methods.js index 7d7dfb5f1c..40f624f293 100644 --- a/test/parallel/test-stream-writable-constructor-set-methods.js +++ b/test/parallel/test-stream-writable-constructor-set-methods.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Writable = require('stream').Writable; +const Writable = require('stream').Writable; var _writeCalled = false; function _write(d, e, n) { diff --git a/test/parallel/test-stream-writable-decoded-encoding.js b/test/parallel/test-stream-writable-decoded-encoding.js index 621e342a3c..4c903a0b01 100644 --- a/test/parallel/test-stream-writable-decoded-encoding.js +++ b/test/parallel/test-stream-writable-decoded-encoding.js @@ -1,9 +1,9 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var stream = require('stream'); -var util = require('util'); +const stream = require('stream'); +const util = require('util'); function MyWritable(fn, options) { stream.Writable.call(this, options); diff --git a/test/parallel/test-stream-writev.js b/test/parallel/test-stream-writev.js index d024abbceb..fc3b099857 100644 --- a/test/parallel/test-stream-writev.js +++ b/test/parallel/test-stream-writev.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var stream = require('stream'); +const stream = require('stream'); var queue = []; for (var decode = 0; decode < 2; decode++) { diff --git a/test/parallel/test-stream2-base64-single-char-read-end.js b/test/parallel/test-stream2-base64-single-char-read-end.js index 50bafc3737..4107533424 100644 --- a/test/parallel/test-stream2-base64-single-char-read-end.js +++ b/test/parallel/test-stream2-base64-single-char-read-end.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var R = require('_stream_readable'); -var W = require('_stream_writable'); -var assert = require('assert'); +const R = require('_stream_readable'); +const W = require('_stream_writable'); +const assert = require('assert'); var src = new R({encoding: 'base64'}); var dst = new W(); diff --git a/test/parallel/test-stream2-compatibility.js b/test/parallel/test-stream2-compatibility.js index 7731245659..d4bf32a199 100644 --- a/test/parallel/test-stream2-compatibility.js +++ b/test/parallel/test-stream2-compatibility.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var R = require('_stream_readable'); -var W = require('_stream_writable'); -var assert = require('assert'); +const R = require('_stream_readable'); +const W = require('_stream_writable'); +const assert = require('assert'); -var util = require('util'); +const util = require('util'); var ondataCalled = 0; diff --git a/test/parallel/test-stream2-finish-pipe.js b/test/parallel/test-stream2-finish-pipe.js index fb489978f4..ee9ee20bd5 100644 --- a/test/parallel/test-stream2-finish-pipe.js +++ b/test/parallel/test-stream2-finish-pipe.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var stream = require('stream'); -var Buffer = require('buffer').Buffer; +const stream = require('stream'); +const Buffer = require('buffer').Buffer; var r = new stream.Readable(); r._read = function(size) { diff --git a/test/parallel/test-stream2-httpclient-response-end.js b/test/parallel/test-stream2-httpclient-response-end.js index d674086055..c4570e8b02 100644 --- a/test/parallel/test-stream2-httpclient-response-end.js +++ b/test/parallel/test-stream2-httpclient-response-end.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const assert = require('assert'); +const http = require('http'); var msg = 'Hello'; var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 823407d396..2a58bb213c 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/test/parallel/test-stream2-large-read-stall.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); // If everything aligns so that you do a read(n) of exactly the // remaining buffer, then make sure that 'end' still emits. @@ -10,7 +10,7 @@ var PUSHSIZE = 20; var PUSHCOUNT = 1000; var HWM = 50; -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; var r = new Readable({ highWaterMark: HWM }); diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index b18be26dc5..6b50ba8436 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var Readable = require('_stream_readable'); -var Writable = require('_stream_writable'); -var assert = require('assert'); +const Readable = require('_stream_readable'); +const Writable = require('_stream_writable'); +const assert = require('assert'); // tiny node-tap lookalike. var tests = []; diff --git a/test/parallel/test-stream2-pipe-error-handling.js b/test/parallel/test-stream2-pipe-error-handling.js index bdf7a4a9a3..cdd1b1a364 100644 --- a/test/parallel/test-stream2-pipe-error-handling.js +++ b/test/parallel/test-stream2-pipe-error-handling.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var stream = require('stream'); +const assert = require('assert'); +const stream = require('stream'); { let count = 1000; diff --git a/test/parallel/test-stream2-pipe-error-once-listener.js b/test/parallel/test-stream2-pipe-error-once-listener.js index c9cfd1d1c8..a2ddb7f5d6 100644 --- a/test/parallel/test-stream2-pipe-error-once-listener.js +++ b/test/parallel/test-stream2-pipe-error-once-listener.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var util = require('util'); -var stream = require('stream'); +const util = require('util'); +const stream = require('stream'); var Read = function() { diff --git a/test/parallel/test-stream2-push.js b/test/parallel/test-stream2-push.js index 445a186715..26f2752907 100644 --- a/test/parallel/test-stream2-push.js +++ b/test/parallel/test-stream2-push.js @@ -1,16 +1,15 @@ 'use strict'; require('../common'); -var stream = require('stream'); -var Readable = stream.Readable; -var Writable = stream.Writable; -var assert = require('assert'); +const Readable = require('stream').Readable; +const Writable = require('stream').Writable; +const assert = require('assert'); -var EE = require('events').EventEmitter; +const EE = require('events').EventEmitter; // a mock thing a bit like the net.Socket/tcp_wrap.handle interaction -stream = new Readable({ +const stream = new Readable({ highWaterMark: 16, encoding: 'utf8' }); diff --git a/test/parallel/test-stream2-read-sync-stack.js b/test/parallel/test-stream2-read-sync-stack.js index b2cfd05f87..1ba31a4b31 100644 --- a/test/parallel/test-stream2-read-sync-stack.js +++ b/test/parallel/test-stream2-read-sync-stack.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; var r = new Readable(); var N = 256 * 1024; diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index 2aa0725f73..e38200e9d6 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -1,9 +1,9 @@ // Flags: --expose_internals 'use strict'; require('../common'); -var assert = require('assert'); -var fromList = require('_stream_readable')._fromList; -var BufferList = require('internal/streams/BufferList'); +const assert = require('assert'); +const fromList = require('_stream_readable')._fromList; +const BufferList = require('internal/streams/BufferList'); // tiny node-tap lookalike. var tests = []; diff --git a/test/parallel/test-stream2-readable-legacy-drain.js b/test/parallel/test-stream2-readable-legacy-drain.js index 8a0687a6eb..1b8a4ac1ff 100644 --- a/test/parallel/test-stream2-readable-legacy-drain.js +++ b/test/parallel/test-stream2-readable-legacy-drain.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Stream = require('stream'); +const Stream = require('stream'); var Readable = Stream.Readable; var r = new Readable(); diff --git a/test/parallel/test-stream2-readable-non-empty-end.js b/test/parallel/test-stream2-readable-non-empty-end.js index c08cc287ce..9800dfdad1 100644 --- a/test/parallel/test-stream2-readable-non-empty-end.js +++ b/test/parallel/test-stream2-readable-non-empty-end.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var Readable = require('_stream_readable'); +const assert = require('assert'); +const Readable = require('_stream_readable'); var len = 0; var chunks = new Array(10); diff --git a/test/parallel/test-stream2-readable-wrap-empty.js b/test/parallel/test-stream2-readable-wrap-empty.js index 02de3cf5b4..aa48c20bb8 100644 --- a/test/parallel/test-stream2-readable-wrap-empty.js +++ b/test/parallel/test-stream2-readable-wrap-empty.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); -var Readable = require('_stream_readable'); -var EE = require('events').EventEmitter; +const Readable = require('_stream_readable'); +const EE = require('events').EventEmitter; var oldStream = new EE(); oldStream.pause = function() {}; diff --git a/test/parallel/test-stream2-readable-wrap.js b/test/parallel/test-stream2-readable-wrap.js index 0cbd106d5b..5a4c8a4c5c 100644 --- a/test/parallel/test-stream2-readable-wrap.js +++ b/test/parallel/test-stream2-readable-wrap.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var Readable = require('_stream_readable'); -var Writable = require('_stream_writable'); -var EE = require('events').EventEmitter; +const Readable = require('_stream_readable'); +const Writable = require('_stream_writable'); +const EE = require('events').EventEmitter; var testRuns = 0, completedRuns = 0; function runTest(highWaterMark, objectMode, produce) { diff --git a/test/parallel/test-stream2-set-encoding.js b/test/parallel/test-stream2-set-encoding.js index 3deb67d48e..c7cc7c3c0b 100644 --- a/test/parallel/test-stream2-set-encoding.js +++ b/test/parallel/test-stream2-set-encoding.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var R = require('_stream_readable'); -var util = require('util'); +const assert = require('assert'); +const R = require('_stream_readable'); +const util = require('util'); // tiny node-tap lookalike. var tests = []; diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 6a4036681f..0777ada97f 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var PassThrough = require('_stream_passthrough'); -var Transform = require('_stream_transform'); +const assert = require('assert'); +const PassThrough = require('_stream_passthrough'); +const Transform = require('_stream_transform'); // tiny node-tap lookalike. var tests = []; diff --git a/test/parallel/test-stream2-unpipe-leak.js b/test/parallel/test-stream2-unpipe-leak.js index d94e39f766..2004a8194c 100644 --- a/test/parallel/test-stream2-unpipe-leak.js +++ b/test/parallel/test-stream2-unpipe-leak.js @@ -1,11 +1,11 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var stream = require('stream'); +const assert = require('assert'); +const stream = require('stream'); var chunk = Buffer.from('hallo'); -var util = require('util'); +const util = require('util'); function TestWriter() { stream.Writable.call(this); diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index 5ecdd0f76e..4d98457e7d 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var W = require('_stream_writable'); -var D = require('_stream_duplex'); -var assert = require('assert'); +const W = require('_stream_writable'); +const D = require('_stream_duplex'); +const assert = require('assert'); -var util = require('util'); +const util = require('util'); util.inherits(TestWriter, W); function TestWriter() { diff --git a/test/parallel/test-stream3-pause-then-read.js b/test/parallel/test-stream3-pause-then-read.js index 64d25fefc9..996f91cf79 100644 --- a/test/parallel/test-stream3-pause-then-read.js +++ b/test/parallel/test-stream3-pause-then-read.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var stream = require('stream'); +const stream = require('stream'); var Readable = stream.Readable; var Writable = stream.Writable; diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js index 33b47a034a..9b6696977c 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -4,8 +4,8 @@ // result of the entire buffer. require('../common'); -var assert = require('assert'); -var SD = require('string_decoder').StringDecoder; +const assert = require('assert'); +const SD = require('string_decoder').StringDecoder; var encodings = ['base64', 'hex', 'utf8', 'utf16le', 'ucs2']; var bufs = [ '☃💩', 'asdf' ].map(function(b) { diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index 151ae8b4e0..97c0aafef2 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var inspect = require('util').inspect; -var StringDecoder = require('string_decoder').StringDecoder; +const assert = require('assert'); +const inspect = require('util').inspect; +const StringDecoder = require('string_decoder').StringDecoder; // Test default encoding var decoder = new StringDecoder(); diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index a34612f75d..e0d8c4552e 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // minimum string size to overflow into external string space var EXTERN_APEX = 0xFBEE9; diff --git a/test/parallel/test-sys.js b/test/parallel/test-sys.js index 3e28f02033..234744bb11 100644 --- a/test/parallel/test-sys.js +++ b/test/parallel/test-sys.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var sys = require('sys'); // eslint-disable-line no-restricted-modules -var util = require('util'); +const assert = require('assert'); +const sys = require('sys'); // eslint-disable-line no-restricted-modules +const util = require('util'); assert.strictEqual(sys, util); diff --git a/test/parallel/test-tcp-wrap-connect.js b/test/parallel/test-tcp-wrap-connect.js index 7ce88d194c..92114bad39 100644 --- a/test/parallel/test-tcp-wrap-connect.js +++ b/test/parallel/test-tcp-wrap-connect.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var TCP = process.binding('tcp_wrap').TCP; var TCPConnectWrap = process.binding('tcp_wrap').TCPConnectWrap; var ShutdownWrap = process.binding('stream_wrap').ShutdownWrap; @@ -39,7 +39,7 @@ var connectCount = 0; var endCount = 0; var shutdownCount = 0; -var server = require('net').Server(function(s) { +const server = require('net').Server(function(s) { connectCount++; s.resume(); s.on('end', function() { diff --git a/test/parallel/test-tcp-wrap.js b/test/parallel/test-tcp-wrap.js index 18b8fe401f..0d023ebf8d 100644 --- a/test/parallel/test-tcp-wrap.js +++ b/test/parallel/test-tcp-wrap.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var TCP = process.binding('tcp_wrap').TCP; var uv = process.binding('uv'); diff --git a/test/parallel/test-timer-close.js b/test/parallel/test-timer-close.js index f13078e5a5..28217ce039 100644 --- a/test/parallel/test-timer-close.js +++ b/test/parallel/test-timer-close.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var t = new (process.binding('timer_wrap').Timer)(); var called = 0; diff --git a/test/parallel/test-timers-args.js b/test/parallel/test-timers-args.js index 21eafd1bcd..4638cb39cc 100644 --- a/test/parallel/test-timers-args.js +++ b/test/parallel/test-timers-args.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); function range(n) { return 'x'.repeat(n + 1).split('').map(function(_, i) { return i; }); diff --git a/test/parallel/test-timers-immediate-queue.js b/test/parallel/test-timers-immediate-queue.js index 62482d510a..fd95230150 100644 --- a/test/parallel/test-timers-immediate-queue.js +++ b/test/parallel/test-timers-immediate-queue.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // setImmediate should run clear its queued cbs once per event loop turn // but immediates queued while processing the current queue should happen diff --git a/test/parallel/test-timers-ordering.js b/test/parallel/test-timers-ordering.js index c23af9d830..79b16338e6 100644 --- a/test/parallel/test-timers-ordering.js +++ b/test/parallel/test-timers-ordering.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var Timer = process.binding('timer_wrap').Timer; var N = 30; diff --git a/test/parallel/test-timers-uncaught-exception.js b/test/parallel/test-timers-uncaught-exception.js index 6b6dc58371..84dae65af4 100644 --- a/test/parallel/test-timers-uncaught-exception.js +++ b/test/parallel/test-timers-uncaught-exception.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var exceptions = 0; var timer1 = 0; diff --git a/test/parallel/test-timers-unref-leak.js b/test/parallel/test-timers-unref-leak.js index a1b1265763..6a1f275ae5 100644 --- a/test/parallel/test-timers-unref-leak.js +++ b/test/parallel/test-timers-unref-leak.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var called = 0; var closed = 0; diff --git a/test/parallel/test-timers-unref.js b/test/parallel/test-timers-unref.js index 801b34792a..c47931b965 100644 --- a/test/parallel/test-timers-unref.js +++ b/test/parallel/test-timers-unref.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); let interval_fired = false; let timeout_fired = false; diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index 0b379e0eb4..38d8fd86b1 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var inputs = [ undefined, diff --git a/test/parallel/test-tls-alert.js b/test/parallel/test-tls-alert.js index db22443918..59cd355f35 100644 --- a/test/parallel/test-tls-alert.js +++ b/test/parallel/test-tls-alert.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.opensslCli) { common.skip('node compiled without OpenSSL CLI.'); @@ -11,10 +11,10 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var spawn = require('child_process').spawn; +const fs = require('fs'); +const spawn = require('child_process').spawn; var success = false; diff --git a/test/parallel/test-tls-async-cb-after-socket-end.js b/test/parallel/test-tls-async-cb-after-socket-end.js index dcde224e04..dc03e74c65 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -10,7 +10,7 @@ const path = require('path'); const fs = require('fs'); const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET; -var tls = require('tls'); +const tls = require('tls'); var options = { secureOptions: SSL_OP_NO_TICKET, diff --git a/test/parallel/test-tls-cert-regression.js b/test/parallel/test-tls-cert-regression.js index a26bab7c46..e74201bc2e 100644 --- a/test/parallel/test-tls-cert-regression.js +++ b/test/parallel/test-tls-cert-regression.js @@ -1,11 +1,11 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); var cert = diff --git a/test/parallel/test-tls-client-abort.js b/test/parallel/test-tls-client-abort.js index d2fcf3e687..f48d22c4fc 100644 --- a/test/parallel/test-tls-client-abort.js +++ b/test/parallel/test-tls-client-abort.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); diff --git a/test/parallel/test-tls-client-abort2.js b/test/parallel/test-tls-client-abort2.js index f3295f6d85..dd224be874 100644 --- a/test/parallel/test-tls-client-abort2.js +++ b/test/parallel/test-tls-client-abort2.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); var conn = tls.connect(common.PORT, common.fail); conn.on('error', common.mustCall(function() { diff --git a/test/parallel/test-tls-client-default-ciphers.js b/test/parallel/test-tls-client-default-ciphers.js index 33766dfd5b..f8fdab1102 100644 --- a/test/parallel/test-tls-client-default-ciphers.js +++ b/test/parallel/test-tls-client-default-ciphers.js @@ -1,12 +1,12 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); function Done() {} diff --git a/test/parallel/test-tls-client-destroy-soon.js b/test/parallel/test-tls-client-destroy-soon.js index 171aa32814..3e79230514 100644 --- a/test/parallel/test-tls-client-destroy-soon.js +++ b/test/parallel/test-tls-client-destroy-soon.js @@ -3,16 +3,16 @@ // Cache session and close connection. Use session on second connection. // ASSERT resumption. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index 1d812a7209..55a32ad6c2 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); process.exit(); } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'); var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'); diff --git a/test/parallel/test-tls-client-resume.js b/test/parallel/test-tls-client-resume.js index 75524a3a18..029f10d449 100644 --- a/test/parallel/test-tls-client-resume.js +++ b/test/parallel/test-tls-client-resume.js @@ -3,16 +3,16 @@ // Cache session and close connection. Use session on second connection. // ASSERT resumption. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), diff --git a/test/parallel/test-tls-close-error.js b/test/parallel/test-tls-close-error.js index 2da7a192c3..6b37d5c1ce 100644 --- a/test/parallel/test-tls-close-error.js +++ b/test/parallel/test-tls-close-error.js @@ -1,15 +1,15 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var server = tls.createServer({ key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index 51b16746e3..3dd2afbd6e 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var server = tls.createServer({ key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js index e2e0238ff8..2b81698664 100644 --- a/test/parallel/test-tls-connect-no-host.js +++ b/test/parallel/test-tls-connect-no-host.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); diff --git a/test/parallel/test-tls-connect-pipe.js b/test/parallel/test-tls-connect-pipe.js index 6ec218e003..67a53c4ebf 100644 --- a/test/parallel/test-tls-connect-pipe.js +++ b/test/parallel/test-tls-connect-pipe.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-tls-connect.js b/test/parallel/test-tls-connect.js index cd4edd89f7..082e2e48a9 100644 --- a/test/parallel/test-tls-connect.js +++ b/test/parallel/test-tls-connect.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); // https://github.com/joyent/node/issues/1218 // uncatchable exception on TLS connection error diff --git a/test/parallel/test-tls-delayed-attach-error.js b/test/parallel/test-tls-delayed-attach-error.js index a5fa91383d..e7cfd4fa6a 100644 --- a/test/parallel/test-tls-delayed-attach-error.js +++ b/test/parallel/test-tls-delayed-attach-error.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); -var fs = require('fs'); -var net = require('net'); +const tls = require('tls'); +const fs = require('fs'); +const net = require('net'); var bonkers = Buffer.alloc(1024, 42); diff --git a/test/parallel/test-tls-delayed-attach.js b/test/parallel/test-tls-delayed-attach.js index b1e4beb231..867fc5edb8 100644 --- a/test/parallel/test-tls-delayed-attach.js +++ b/test/parallel/test-tls-delayed-attach.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var net = require('net'); +const fs = require('fs'); +const net = require('net'); var sent = 'hello world'; var received = ''; diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 196f5eb497..6340833765 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var spawn = require('child_process').spawn; -var fs = require('fs'); +const spawn = require('child_process').spawn; +const fs = require('fs'); var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'); var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'); var nsuccess = 0; diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index c2a7440a68..df51c5d085 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var exec = require('child_process').exec; -var fs = require('fs'); +const exec = require('child_process').exec; +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), diff --git a/test/parallel/test-tls-econnreset.js b/test/parallel/test-tls-econnreset.js index d9f6fffd32..51f178198f 100644 --- a/test/parallel/test-tls-econnreset.js +++ b/test/parallel/test-tls-econnreset.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); var cacert = `-----BEGIN CERTIFICATE----- diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 034a629665..33665536ba 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var dir = common.fixturesDir; var options = { key: fs.readFileSync(dir + '/test_key.pem'), diff --git a/test/parallel/test-tls-handshake-error.js b/test/parallel/test-tls-handshake-error.js index e76a0961fb..4d6a64a150 100644 --- a/test/parallel/test-tls-handshake-error.js +++ b/test/parallel/test-tls-handshake-error.js @@ -1,15 +1,15 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var server = tls.createServer({ key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-tls-handshake-nohang.js b/test/parallel/test-tls-handshake-nohang.js index 052833a50e..039c55b486 100644 --- a/test/parallel/test-tls-handshake-nohang.js +++ b/test/parallel/test-tls-handshake-nohang.js @@ -1,11 +1,11 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); // neither should hang tls.createSecurePair(null, false, false, false); diff --git a/test/parallel/test-tls-honorcipherorder.js b/test/parallel/test-tls-honorcipherorder.js index 81c2440fe2..883abc199e 100644 --- a/test/parallel/test-tls-honorcipherorder.js +++ b/test/parallel/test-tls-honorcipherorder.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var nconns = 0; // We explicitly set TLS version to 1.2 so as to be safe when the diff --git a/test/parallel/test-tls-invoke-queued.js b/test/parallel/test-tls-invoke-queued.js index 4008e5f099..b37b900d77 100644 --- a/test/parallel/test-tls-invoke-queued.js +++ b/test/parallel/test-tls-invoke-queued.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var received = ''; diff --git a/test/parallel/test-tls-js-stream.js b/test/parallel/test-tls-js-stream.js index 08095fa995..2f69a306cf 100644 --- a/test/parallel/test-tls-js-stream.js +++ b/test/parallel/test-tls-js-stream.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var stream = require('stream'); -var fs = require('fs'); -var net = require('net'); +const stream = require('stream'); +const fs = require('fs'); +const net = require('net'); var connected = { client: 0, diff --git a/test/parallel/test-tls-legacy-onselect.js b/test/parallel/test-tls-legacy-onselect.js index 72c748248e..392df2e715 100644 --- a/test/parallel/test-tls-legacy-onselect.js +++ b/test/parallel/test-tls-legacy-onselect.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); -var net = require('net'); +const tls = require('tls'); +const net = require('net'); var server = net.Server(common.mustCall(function(raw) { var pair = tls.createSecurePair(null, true, false, false); diff --git a/test/parallel/test-tls-max-send-fragment.js b/test/parallel/test-tls-max-send-fragment.js index 64dd146989..d96f42e6a2 100644 --- a/test/parallel/test-tls-max-send-fragment.js +++ b/test/parallel/test-tls-max-send-fragment.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var buf = Buffer.allocUnsafe(10000); var received = 0; diff --git a/test/parallel/test-tls-multi-key.js b/test/parallel/test-tls-multi-key.js index e29f5ee522..840deb59d4 100644 --- a/test/parallel/test-tls-multi-key.js +++ b/test/parallel/test-tls-multi-key.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); -var fs = require('fs'); +const tls = require('tls'); +const fs = require('fs'); var options = { key: [ diff --git a/test/parallel/test-tls-no-rsa-key.js b/test/parallel/test-tls-no-rsa-key.js index cc04534bf9..1e75b21eab 100644 --- a/test/parallel/test-tls-no-rsa-key.js +++ b/test/parallel/test-tls-no-rsa-key.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/ec-key.pem'), diff --git a/test/parallel/test-tls-no-sslv23.js b/test/parallel/test-tls-no-sslv23.js index 0db61afe0e..ff1214d167 100644 --- a/test/parallel/test-tls-no-sslv23.js +++ b/test/parallel/test-tls-no-sslv23.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); assert.throws(function() { tls.createSecureContext({ secureProtocol: 'blargh' }); diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js index a5fe2da3a2..fdd9fcbb32 100644 --- a/test/parallel/test-tls-npn-server-client.js +++ b/test/parallel/test-tls-npn-server-client.js @@ -13,7 +13,7 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); function filenamePEM(n) { diff --git a/test/parallel/test-tls-over-http-tunnel.js b/test/parallel/test-tls-over-http-tunnel.js index c030c7482f..f55f1c0ac0 100644 --- a/test/parallel/test-tls-over-http-tunnel.js +++ b/test/parallel/test-tls-over-http-tunnel.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); -var net = require('net'); -var http = require('http'); +const fs = require('fs'); +const net = require('net'); +const http = require('http'); var gotRequest = false; diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js index 7f4e02a1bf..aa48c04866 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); var options = { key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js index b59d10faa7..1062dab2af 100644 --- a/test/parallel/test-tls-peer-certificate-encoding.js +++ b/test/parallel/test-tls-peer-certificate-encoding.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var util = require('util'); -var join = require('path').join; +const fs = require('fs'); +const util = require('util'); +const join = require('path').join; var options = { key: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent5-key.pem')), diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index 55bc9f40d3..6176a34a71 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var util = require('util'); -var join = require('path').join; +const fs = require('fs'); +const util = require('util'); +const join = require('path').join; var options = { key: fs.readFileSync(join(common.fixturesDir, 'agent.key')), diff --git a/test/parallel/test-tls-request-timeout.js b/test/parallel/test-tls-request-timeout.js index fc793def17..2d1ddf34b3 100644 --- a/test/parallel/test-tls-request-timeout.js +++ b/test/parallel/test-tls-request-timeout.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-tls-securepair-server.js b/test/parallel/test-tls-securepair-server.js index 24ac2177c5..afe76a0139 100644 --- a/test/parallel/test-tls-securepair-server.js +++ b/test/parallel/test-tls-securepair-server.js @@ -1,17 +1,17 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var join = require('path').join; -var net = require('net'); -var fs = require('fs'); -var spawn = require('child_process').spawn; +const join = require('path').join; +const net = require('net'); +const fs = require('fs'); +const spawn = require('child_process').spawn; var key = fs.readFileSync(join(common.fixturesDir, 'agent.key')).toString(); var cert = fs.readFileSync(join(common.fixturesDir, 'agent.crt')).toString(); diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index d9823fa3da..436618379a 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -13,7 +13,7 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); function filenamePEM(n) { return require('path').join(common.fixturesDir, 'keys', n + '.pem'); diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index 7a8046c743..a22b6a9726 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -13,7 +13,7 @@ if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); function filenamePEM(n) { return require('path').join(common.fixturesDir, 'keys', n + '.pem'); diff --git a/test/parallel/test-umask.js b/test/parallel/test-umask.js index 62f9d82b33..397f26ce90 100644 --- a/test/parallel/test-umask.js +++ b/test/parallel/test-umask.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); // Note in Windows one can only set the "user" bits. var mask; diff --git a/test/parallel/test-utf8-scripts.js b/test/parallel/test-utf8-scripts.js index 98c26594bb..484d3bdefe 100644 --- a/test/parallel/test-utf8-scripts.js +++ b/test/parallel/test-utf8-scripts.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); // üäö diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 477e2a6e30..9120729e49 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -270,7 +270,7 @@ assert.strictEqual(util.inspect(value), '{ 2010-02-14T11:48:40.000Z aprop: 42 }' ); // test the internal isDate implementation -var Date2 = require('vm').runInNewContext('Date'); +const Date2 = vm.runInNewContext('Date'); var d = new Date2(); var orig = util.inspect(d); Date2.prototype.foo = 'bar'; @@ -294,7 +294,7 @@ assert.strictEqual(util.inspect(new Array(5)), '[ , , , , ]'); // test for Array constructor in different context { - const Debug = require('vm').runInDebugContext('Debug'); + const Debug = vm.runInDebugContext('Debug'); const map = new Map(); map.set(1, 2); const mirror = Debug.MakeMirror(map.entries(), true); @@ -308,13 +308,13 @@ assert.strictEqual(util.inspect(new Array(5)), '[ , , , , ]'); } // test for other constructors in different context -var obj = require('vm').runInNewContext('(function(){return {}})()', {}); +let obj = vm.runInNewContext('(function(){return {}})()', {}); assert.strictEqual(util.inspect(obj), '{}'); -obj = require('vm').runInNewContext('var m=new Map();m.set(1,2);m', {}); +obj = vm.runInNewContext('var m=new Map();m.set(1,2);m', {}); assert.strictEqual(util.inspect(obj), 'Map { 1 => 2 }'); -obj = require('vm').runInNewContext('var s=new Set();s.add(1);s.add(2);s', {}); +obj = vm.runInNewContext('var s=new Set();s.add(1);s.add(2);s', {}); assert.strictEqual(util.inspect(obj), 'Set { 1, 2 }'); -obj = require('vm').runInNewContext('fn=function(){};new Promise(fn,fn)', {}); +obj = vm.runInNewContext('fn=function(){};new Promise(fn,fn)', {}); assert.strictEqual(util.inspect(obj), 'Promise { <pending> }'); // test for property descriptors diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index 91f77d994d..8480bf83ea 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var util = require('util'); +const assert = require('assert'); +const util = require('util'); assert.ok(process.stdout.writable); assert.ok(process.stderr.writable); diff --git a/test/parallel/test-v8-flag-type-check.js b/test/parallel/test-v8-flag-type-check.js index 986f37314d..b5d4d7c2f1 100644 --- a/test/parallel/test-v8-flag-type-check.js +++ b/test/parallel/test-v8-flag-type-check.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var v8 = require('v8'); +const assert = require('assert'); +const v8 = require('v8'); assert.throws(function() { v8.setFlagsFromString(1); }, TypeError); assert.throws(function() { v8.setFlagsFromString(); }, TypeError); diff --git a/test/parallel/test-v8-flags.js b/test/parallel/test-v8-flags.js index 50cff9ecef..9938408051 100644 --- a/test/parallel/test-v8-flags.js +++ b/test/parallel/test-v8-flags.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var v8 = require('v8'); -var vm = require('vm'); +const assert = require('assert'); +const v8 = require('v8'); +const vm = require('vm'); // Note: changing V8 flags after an isolate started is not guaranteed to work. // Specifically here, V8 may cache compiled scripts between the flip of the diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js index 74a9977fbc..dc36beac13 100644 --- a/test/parallel/test-v8-stats.js +++ b/test/parallel/test-v8-stats.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var v8 = require('v8'); +const assert = require('assert'); +const v8 = require('v8'); var s = v8.getHeapStatistics(); var keys = [ diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index b2b280c21b..75163d6cd3 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); // Test 1: vm.runInNewContext var sandbox = {}; diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js index aa2dd26ad5..35ab236ae1 100644 --- a/test/parallel/test-vm-cached-data.js +++ b/test/parallel/test-vm-cached-data.js @@ -15,8 +15,8 @@ function produce(source, count) { const out = spawnSync(process.execPath, [ '-e', ` 'use strict'; - var assert = require('assert'); - var vm = require('vm'); + const assert = require('assert'); + const vm = require('vm'); var data; for (var i = 0; i < ${count}; i++) { diff --git a/test/parallel/test-vm-context-async-script.js b/test/parallel/test-vm-context-async-script.js index b09eda8520..b4045fbfd3 100644 --- a/test/parallel/test-vm-context-async-script.js +++ b/test/parallel/test-vm-context-async-script.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); var sandbox = { setTimeout: setTimeout }; diff --git a/test/parallel/test-vm-context-property-forwarding.js b/test/parallel/test-vm-context-property-forwarding.js index 4034441615..03faef596f 100644 --- a/test/parallel/test-vm-context-property-forwarding.js +++ b/test/parallel/test-vm-context-property-forwarding.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); var sandbox = { x: 3 }; diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index d3269d9035..48319be3a9 100644 --- a/test/parallel/test-vm-context.js +++ b/test/parallel/test-vm-context.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var vm = require('vm'); +const vm = require('vm'); var Script = vm.Script; var script = new Script('"passed";'); @@ -48,7 +48,7 @@ assert.ok(gh1140Exception, // Issue GH-693: console.error('test RegExp as argument to assert.throws'); -script = vm.createScript('var assert = require(\'assert\'); assert.throws(' + +script = vm.createScript('const assert = require(\'assert\'); assert.throws(' + 'function() { throw "hello world"; }, /hello/);', 'some.js'); script.runInNewContext({ require: require }); diff --git a/test/parallel/test-vm-create-and-run-in-context.js b/test/parallel/test-vm-create-and-run-in-context.js index fc92cf2f6c..b40491bb61 100644 --- a/test/parallel/test-vm-create-and-run-in-context.js +++ b/test/parallel/test-vm-create-and-run-in-context.js @@ -1,9 +1,9 @@ 'use strict'; // Flags: --expose-gc require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var vm = require('vm'); +const vm = require('vm'); console.error('run in a new empty context'); var context = vm.createContext(); diff --git a/test/parallel/test-vm-create-context-accessors.js b/test/parallel/test-vm-create-context-accessors.js index 497bab1a57..3870b68247 100644 --- a/test/parallel/test-vm-create-context-accessors.js +++ b/test/parallel/test-vm-create-context-accessors.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); var ctx = {}; diff --git a/test/parallel/test-vm-create-context-arg.js b/test/parallel/test-vm-create-context-arg.js index a0c2976233..76634e5bef 100644 --- a/test/parallel/test-vm-create-context-arg.js +++ b/test/parallel/test-vm-create-context-arg.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); assert.throws(function() { vm.createContext('string is not supported'); diff --git a/test/parallel/test-vm-create-context-circular-reference.js b/test/parallel/test-vm-create-context-circular-reference.js index 248ef24f69..e6c1ab8b85 100644 --- a/test/parallel/test-vm-create-context-circular-reference.js +++ b/test/parallel/test-vm-create-context-circular-reference.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); var sbx = {}; sbx.window = sbx; diff --git a/test/parallel/test-vm-cross-context.js b/test/parallel/test-vm-cross-context.js index 5674f58242..c1d115b50b 100644 --- a/test/parallel/test-vm-cross-context.js +++ b/test/parallel/test-vm-cross-context.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var vm = require('vm'); +const vm = require('vm'); var ctx = vm.createContext(global); assert.doesNotThrow(function() { diff --git a/test/parallel/test-vm-function-declaration.js b/test/parallel/test-vm-function-declaration.js index fd41be7564..976313b5f6 100644 --- a/test/parallel/test-vm-function-declaration.js +++ b/test/parallel/test-vm-function-declaration.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var vm = require('vm'); +const vm = require('vm'); var o = vm.createContext({ console: console }); // This triggers the setter callback in node_contextify.cc diff --git a/test/parallel/test-vm-global-define-property.js b/test/parallel/test-vm-global-define-property.js index 73d1520e0d..31842ced2a 100644 --- a/test/parallel/test-vm-global-define-property.js +++ b/test/parallel/test-vm-global-define-property.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var vm = require('vm'); +const vm = require('vm'); var code = 'Object.defineProperty(this, "f", {\n' + diff --git a/test/parallel/test-vm-global-identity.js b/test/parallel/test-vm-global-identity.js index 7d90408b64..876318aece 100644 --- a/test/parallel/test-vm-global-identity.js +++ b/test/parallel/test-vm-global-identity.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); var ctx = vm.createContext(); ctx.window = ctx; diff --git a/test/parallel/test-vm-harmony-symbols.js b/test/parallel/test-vm-harmony-symbols.js index 1c1274ef35..eeacdaed18 100644 --- a/test/parallel/test-vm-harmony-symbols.js +++ b/test/parallel/test-vm-harmony-symbols.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); // The sandbox should have its own Symbol constructor. var sandbox = {}; diff --git a/test/parallel/test-vm-is-context.js b/test/parallel/test-vm-is-context.js index cc106a15fb..474c0686a8 100644 --- a/test/parallel/test-vm-is-context.js +++ b/test/parallel/test-vm-is-context.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); assert.throws(function() { vm.isContext('string is not supported'); diff --git a/test/parallel/test-vm-proxies.js b/test/parallel/test-vm-proxies.js index d908d71374..6532345336 100644 --- a/test/parallel/test-vm-proxies.js +++ b/test/parallel/test-vm-proxies.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); // src/node_contextify.cc filters out the Proxy object from the parent // context. Make sure that the new context has a Proxy object of its own. diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js index c4f10c183b..0f578ac5f8 100644 --- a/test/parallel/test-vm-static-this.js +++ b/test/parallel/test-vm-static-this.js @@ -1,7 +1,7 @@ /* eslint-disable strict */ -var common = require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const common = require('../common'); +const assert = require('assert'); +const vm = require('vm'); common.globalCheck = false; diff --git a/test/parallel/test-vm-syntax-error-message.js b/test/parallel/test-vm-syntax-error-message.js index 75748b24e1..b4c101d580 100644 --- a/test/parallel/test-vm-syntax-error-message.js +++ b/test/parallel/test-vm-syntax-error-message.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var child_process = require('child_process'); +const assert = require('assert'); +const child_process = require('child_process'); var p = child_process.spawn(process.execPath, [ '-e', diff --git a/test/parallel/test-vm-timeout.js b/test/parallel/test-vm-timeout.js index 0536ae37a1..5b78c891e8 100644 --- a/test/parallel/test-vm-timeout.js +++ b/test/parallel/test-vm-timeout.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const assert = require('assert'); +const vm = require('vm'); // Test 1: Timeout of 100ms executing endless loop assert.throws(function() { diff --git a/test/parallel/test-zerolengthbufferbug.js b/test/parallel/test-zerolengthbufferbug.js index 9e2cde6b2f..b74f906fff 100644 --- a/test/parallel/test-zerolengthbufferbug.js +++ b/test/parallel/test-zerolengthbufferbug.js @@ -2,7 +2,7 @@ // Serving up a zero-length buffer should work. const common = require('../common'); -var http = require('http'); +const http = require('http'); var server = http.createServer(function(req, res) { var buffer = Buffer.alloc(0); diff --git a/test/pummel/test-abort-fatal-error.js b/test/pummel/test-abort-fatal-error.js index 0bb2cb2c39..1fed91d54a 100644 --- a/test/pummel/test-abort-fatal-error.js +++ b/test/pummel/test-abort-fatal-error.js @@ -1,13 +1,13 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (common.isWindows) { common.skip('no RLIMIT_NOFILE on Windows'); return; } -var exec = require('child_process').exec; +const exec = require('child_process').exec; var cmdline = 'ulimit -c 0; ' + process.execPath; cmdline += ' --max-old-space-size=4 --max-semi-space-size=1'; diff --git a/test/pummel/test-child-process-spawn-loop.js b/test/pummel/test-child-process-spawn-loop.js index 7e686cada2..f7cf1fad2d 100644 --- a/test/pummel/test-child-process-spawn-loop.js +++ b/test/pummel/test-child-process-spawn-loop.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; var SIZE = 1000 * 1024; var N = 40; diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index 448319318b..8228332e5d 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); var p = crypto.createDiffieHellman(1024).getPrime(); diff --git a/test/pummel/test-dtrace-jsstack.js b/test/pummel/test-dtrace-jsstack.js index 1949045888..af9c83bb3e 100644 --- a/test/pummel/test-dtrace-jsstack.js +++ b/test/pummel/test-dtrace-jsstack.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var os = require('os'); +const assert = require('assert'); +const os = require('os'); if (!common.isSunOS) { common.skip('no DTRACE support'); @@ -31,7 +31,7 @@ var doogle = function() { bagnoogle('The bfs command', '(almost) like ed(1)'); }; -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; /* * We're going to use DTrace to stop us, gcore us, and set us running again diff --git a/test/pummel/test-exec.js b/test/pummel/test-exec.js index 6f6e1511b1..c87aa2d6e6 100644 --- a/test/pummel/test-exec.js +++ b/test/pummel/test-exec.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var exec = require('child_process').exec; +const common = require('../common'); +const assert = require('assert'); +const exec = require('child_process').exec; var SLEEP3_COMMAND; if (!common.isWindows) { diff --git a/test/pummel/test-fs-watch-file-slow.js b/test/pummel/test-fs-watch-file-slow.js index 508de487f6..e64e00b32f 100644 --- a/test/pummel/test-fs-watch-file-slow.js +++ b/test/pummel/test-fs-watch-file-slow.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); var FILENAME = path.join(common.tmpDir, 'watch-me'); var TIMEOUT = 1300; diff --git a/test/pummel/test-fs-watch-file.js b/test/pummel/test-fs-watch-file.js index 4e08e9e9d1..90acdccebe 100644 --- a/test/pummel/test-fs-watch-file.js +++ b/test/pummel/test-fs-watch-file.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); var watchSeenOne = 0; var watchSeenTwo = 0; diff --git a/test/pummel/test-fs-watch-non-recursive.js b/test/pummel/test-fs-watch-non-recursive.js index ead7de9e28..7b40ef75ac 100644 --- a/test/pummel/test-fs-watch-non-recursive.js +++ b/test/pummel/test-fs-watch-non-recursive.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const path = require('path'); +const fs = require('fs'); var testDir = common.tmpDir; var testsubdir = path.join(testDir, 'testsubdir'); diff --git a/test/pummel/test-http-many-keep-alive-connections.js b/test/pummel/test-http-many-keep-alive-connections.js index 293c6ab748..a7654f4524 100644 --- a/test/pummel/test-http-many-keep-alive-connections.js +++ b/test/pummel/test-http-many-keep-alive-connections.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); var expected = 10000; var responses = 0; diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 8bda7cc102..61e60c2673 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); -var https = require('https'); +const tls = require('tls'); +const https = require('https'); -var fs = require('fs'); +const fs = require('fs'); if (!common.opensslCli) { common.skip('node compiled without OpenSSL CLI.'); diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index a122e47bc5..8a3aa022ea 100644 --- a/test/pummel/test-https-large-response.js +++ b/test/pummel/test-https-large-response.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var fs = require('fs'); +const fs = require('fs'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index fab5959199..b6cc32c999 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var Buffer = require('buffer').Buffer; -var fs = require('fs'); -var path = require('path'); +const Buffer = require('buffer').Buffer; +const fs = require('fs'); +const path = require('path'); var options = { key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js index 1861b2df97..d36c542ed8 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -1,11 +1,11 @@ 'use strict'; // This test requires the program 'wrk' -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; -var http = require('http'); -var url = require('url'); +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; +const http = require('http'); +const url = require('url'); if (common.isWindows) { common.skip('no `wrk` on windows'); diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js index 2b6dc84f37..bd61dabc6b 100644 --- a/test/pummel/test-net-connect-econnrefused.js +++ b/test/pummel/test-net-connect-econnrefused.js @@ -1,9 +1,9 @@ 'use strict'; // verify that connect reqs are properly cleaned up -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); var ROUNDS = 10; var ATTEMPTS_PER_ROUND = 100; diff --git a/test/pummel/test-net-connect-memleak.js b/test/pummel/test-net-connect-memleak.js index 3b91a110ea..a5d8ff47eb 100644 --- a/test/pummel/test-net-connect-memleak.js +++ b/test/pummel/test-net-connect-memleak.js @@ -1,9 +1,9 @@ 'use strict'; // Flags: --expose-gc -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); assert.strictEqual( typeof global.gc, diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js index 52d05b35cb..db98e55433 100644 --- a/test/pummel/test-net-many-clients.js +++ b/test/pummel/test-net-many-clients.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); // settings var bytes = 1024 * 40; diff --git a/test/pummel/test-net-pause.js b/test/pummel/test-net-pause.js index b0c5126043..59749e75fa 100644 --- a/test/pummel/test-net-pause.js +++ b/test/pummel/test-net-pause.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); var N = 200; var recv = '', chars_recved = 0; diff --git a/test/pummel/test-net-pingpong-delay.js b/test/pummel/test-net-pingpong-delay.js index c9cac778d5..4e478c87a6 100644 --- a/test/pummel/test-net-pingpong-delay.js +++ b/test/pummel/test-net-pingpong-delay.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); function pingPongTest(port, host, on_complete) { var N = 100; diff --git a/test/pummel/test-net-pingpong.js b/test/pummel/test-net-pingpong.js index 85dce02b6c..b65d5d4ff9 100644 --- a/test/pummel/test-net-pingpong.js +++ b/test/pummel/test-net-pingpong.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); var tests_run = 0; diff --git a/test/pummel/test-net-timeout.js b/test/pummel/test-net-timeout.js index 415523763e..e4f8664657 100644 --- a/test/pummel/test-net-timeout.js +++ b/test/pummel/test-net-timeout.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); var exchanges = 0; var starttime = null; diff --git a/test/pummel/test-net-timeout2.js b/test/pummel/test-net-timeout2.js index 7af47a47a8..5567b128c7 100644 --- a/test/pummel/test-net-timeout2.js +++ b/test/pummel/test-net-timeout2.js @@ -2,8 +2,8 @@ // socket.write was not resetting the timeout timer. See // https://github.com/joyent/node/issues/2002 -var common = require('../common'); -var net = require('net'); +const common = require('../common'); +const net = require('net'); var seconds = 5; var counter = 0; diff --git a/test/pummel/test-net-write-callbacks.js b/test/pummel/test-net-write-callbacks.js index 21eae0f5ab..54f8a67abe 100644 --- a/test/pummel/test-net-write-callbacks.js +++ b/test/pummel/test-net-write-callbacks.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var net = require('net'); -var assert = require('assert'); +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); var cbcount = 0; var N = 500000; diff --git a/test/pummel/test-process-hrtime.js b/test/pummel/test-process-hrtime.js index 04225bae42..0149ef2bf5 100644 --- a/test/pummel/test-process-hrtime.js +++ b/test/pummel/test-process-hrtime.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); var start = process.hrtime(); diff --git a/test/pummel/test-process-uptime.js b/test/pummel/test-process-uptime.js index 8d2d88b74f..90343e91a1 100644 --- a/test/pummel/test-process-uptime.js +++ b/test/pummel/test-process-uptime.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); console.error(process.uptime()); assert.ok(process.uptime() <= 2); diff --git a/test/pummel/test-regress-GH-814.js b/test/pummel/test-regress-GH-814.js index 7bbd13dd19..4633844ee1 100644 --- a/test/pummel/test-regress-GH-814.js +++ b/test/pummel/test-regress-GH-814.js @@ -13,8 +13,8 @@ function newBuffer(size, value) { return buffer; } -var fs = require('fs'); -var testFileName = require('path').join(common.tmpDir, 'GH-814_testFile.txt'); +const fs = require('fs'); +const testFileName = require('path').join(common.tmpDir, 'GH-814_testFile.txt'); var testFileFD = fs.openSync(testFileName, 'w'); console.log(testFileName); @@ -25,7 +25,7 @@ var neverWrittenBuffer = newBuffer(kBufSize, 0x2e); //0x2e === '.' var bufPool = []; -var tail = require('child_process').spawn('tail', ['-f', testFileName]); +const tail = require('child_process').spawn('tail', ['-f', testFileName]); tail.stdout.on('data', tailCB); function tailCB(data) { diff --git a/test/pummel/test-regress-GH-814_2.js b/test/pummel/test-regress-GH-814_2.js index 7909a461f3..31c1852985 100644 --- a/test/pummel/test-regress-GH-814_2.js +++ b/test/pummel/test-regress-GH-814_2.js @@ -1,15 +1,15 @@ 'use strict'; // Flags: --expose_gc -var common = require('../common'); +const common = require('../common'); -var fs = require('fs'); -var testFileName = require('path').join(common.tmpDir, 'GH-814_test.txt'); +const fs = require('fs'); +const testFileName = require('path').join(common.tmpDir, 'GH-814_test.txt'); var testFD = fs.openSync(testFileName, 'w'); console.error(testFileName + '\n'); -var tailProc = require('child_process').spawn('tail', ['-f', testFileName]); +const tailProc = require('child_process').spawn('tail', ['-f', testFileName]); tailProc.stdout.on('data', tailCB); function tailCB(data) { diff --git a/test/pummel/test-regress-GH-892.js b/test/pummel/test-regress-GH-892.js index 8bbf3c8f1a..9a2fce08a7 100644 --- a/test/pummel/test-regress-GH-892.js +++ b/test/pummel/test-regress-GH-892.js @@ -5,23 +5,24 @@ // to POST a 32mb file to us. A bug in the pause/resume functionality of the // TLS server causes the child process to exit cleanly before having sent // the entire buffer. -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var https = require('https'); +const https = require('https'); -var fs = require('fs'); +const fs = require('fs'); var bytesExpected = 1024 * 1024 * 32; var started = false; -var childScript = require('path').join(common.fixturesDir, 'GH-892-request.js'); +const childScript = require('path').join(common.fixturesDir, + 'GH-892-request.js'); function makeRequest() { if (started) return; diff --git a/test/pummel/test-stream-pipe-multi.js b/test/pummel/test-stream-pipe-multi.js index 897b9d6dc2..3c62548e5b 100644 --- a/test/pummel/test-stream-pipe-multi.js +++ b/test/pummel/test-stream-pipe-multi.js @@ -3,8 +3,8 @@ // doesn't break anything. require('../common'); -var assert = require('assert'); -var Stream = require('stream').Stream; +const assert = require('assert'); +const Stream = require('stream').Stream; var rr = []; var ww = []; var cnt = 100; diff --git a/test/pummel/test-stream2-basic.js b/test/pummel/test-stream2-basic.js index 6bb2386b0b..3659b267fa 100644 --- a/test/pummel/test-stream2-basic.js +++ b/test/pummel/test-stream2-basic.js @@ -1,10 +1,10 @@ 'use strict'; require('../common'); -var R = require('_stream_readable'); -var assert = require('assert'); +const R = require('_stream_readable'); +const assert = require('assert'); -var util = require('util'); -var EE = require('events').EventEmitter; +const util = require('util'); +const EE = require('events').EventEmitter; function TestReader(n) { R.apply(this); diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 588d2327ff..83a8eeffeb 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); var WINDOW = 200; // why is does this need to be so big? diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js index 5075806c10..c8f78e0609 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/pummel/test-tls-ci-reneg-attack.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); if (!common.opensslCli) { common.skip('node compiled without OpenSSL CLI.'); diff --git a/test/pummel/test-tls-connect-memleak.js b/test/pummel/test-tls-connect-memleak.js index b55e33cee0..46e7f425df 100644 --- a/test/pummel/test-tls-connect-memleak.js +++ b/test/pummel/test-tls-connect-memleak.js @@ -1,16 +1,16 @@ 'use strict'; // Flags: --expose-gc -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); +const fs = require('fs'); assert.strictEqual( typeof global.gc, diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js index 7a1b877013..c47cc60301 100644 --- a/test/pummel/test-tls-securepair-client.js +++ b/test/pummel/test-tls-securepair-client.js @@ -1,7 +1,7 @@ 'use strict'; // -var common = require('../common'); +const common = require('../common'); if (!common.opensslCli) { common.skip('node compiled without OpenSSL CLI.'); @@ -13,12 +13,12 @@ if (!common.hasCrypto) { return; } -var join = require('path').join; -var net = require('net'); -var assert = require('assert'); -var fs = require('fs'); -var tls = require('tls'); -var spawn = require('child_process').spawn; +const join = require('path').join; +const net = require('net'); +const assert = require('assert'); +const fs = require('fs'); +const tls = require('tls'); +const spawn = require('child_process').spawn; test1(); diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js index 66d700ae4b..1b43a55835 100644 --- a/test/pummel/test-tls-server-large-request.js +++ b/test/pummel/test-tls-server-large-request.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var stream = require('stream'); -var util = require('util'); +const fs = require('fs'); +const stream = require('stream'); +const util = require('util'); var request = Buffer.from(new Array(1024 * 256).join('ABCD')); // 1mb diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js index c23a8afcf7..ffa44a9702 100644 --- a/test/pummel/test-tls-session-timeout.js +++ b/test/pummel/test-tls-session-timeout.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); if (!common.opensslCli) { common.skip('node compiled without OpenSSL CLI.'); @@ -22,11 +22,11 @@ doTest(); // that we used has expired by now. function doTest() { - var assert = require('assert'); - var tls = require('tls'); - var fs = require('fs'); - var join = require('path').join; - var spawn = require('child_process').spawn; + const assert = require('assert'); + const tls = require('tls'); + const fs = require('fs'); + const join = require('path').join; + const spawn = require('child_process').spawn; var SESSION_TIMEOUT = 1; diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index a93793989f..581355d61b 100644 --- a/test/pummel/test-tls-throttle.js +++ b/test/pummel/test-tls-throttle.js @@ -2,15 +2,15 @@ // Server sends a large string. Client counts bytes and pauses every few // seconds. Makes sure that pause and resume work properly. -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); -var fs = require('fs'); +const tls = require('tls'); +const fs = require('fs'); process.stdout.write('build body...'); var body = 'hello world\n'.repeat(1024 * 1024); diff --git a/test/pummel/test-vm-memleak.js b/test/pummel/test-vm-memleak.js index c662399192..6f26c9a590 100644 --- a/test/pummel/test-vm-memleak.js +++ b/test/pummel/test-vm-memleak.js @@ -2,7 +2,7 @@ // Flags: --max_old_space_size=32 require('../common'); -var assert = require('assert'); +const assert = require('assert'); var start = Date.now(); var maxMem = 0; diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js index 8fdf6b32b2..0f6f2d5fc8 100644 --- a/test/pummel/test-watch-file.js +++ b/test/pummel/test-watch-file.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); var f = path.join(common.fixturesDir, 'x.txt'); diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index e40651dacf..710137e419 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var execSync = require('child_process').execSync; -var execFileSync = require('child_process').execFileSync; +const execSync = require('child_process').execSync; +const execFileSync = require('child_process').execFileSync; var TIMER = 200; var SLEEP = 2000; diff --git a/test/sequential/test-debugger-debug-brk.js b/test/sequential/test-debugger-debug-brk.js index 3b54f853bc..85ebe2ad17 100644 --- a/test/sequential/test-debugger-debug-brk.js +++ b/test/sequential/test-debugger-debug-brk.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; var script = common.fixturesDir + '/empty.js'; diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index 61746a282f..54fcc5c06a 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); console.error('load test-module-loading.js'); @@ -15,21 +15,21 @@ assert.strictEqual(process.mainModule, module, require('../fixtures/not-main-module.js'); // require a file with a request that includes the extension -var a_js = require('../fixtures/a.js'); +const a_js = require('../fixtures/a.js'); assert.strictEqual(42, a_js.number); // require a file without any extensions -var foo_no_ext = require('../fixtures/foo'); +const foo_no_ext = require('../fixtures/foo'); assert.strictEqual('ok', foo_no_ext.foo); -var a = require('../fixtures/a'); -var c = require('../fixtures/b/c'); -var d = require('../fixtures/b/d'); -var d2 = require('../fixtures/b/d'); +const a = require('../fixtures/a'); +const c = require('../fixtures/b/c'); +const d = require('../fixtures/b/d'); +const d2 = require('../fixtures/b/d'); // Absolute -var d3 = require(path.join(__dirname, '../fixtures/b/d')); +const d3 = require(path.join(__dirname, '../fixtures/b/d')); // Relative -var d4 = require('../fixtures/b/d'); +const d4 = require('../fixtures/b/d'); assert.strictEqual(false, false, 'testing the test program.'); @@ -96,7 +96,7 @@ require('../fixtures/node_modules/foo'); console.error('test name clashes'); // this one exists and should import the local module -var my_path = require('../fixtures/path'); +const my_path = require('../fixtures/path'); assert.ok(my_path.path_func instanceof Function); // this one does not exist and should throw assert.throws(function() { require('./utils'); }); @@ -175,13 +175,13 @@ assert.strictEqual(require(loadOrder + 'file9').file9, 'file9/index.reg2', msg); // make sure that module.require() is the same as // doing require() inside of that module. -var parent = require('../fixtures/module-require/parent/'); -var child = require('../fixtures/module-require/child/'); +const parent = require('../fixtures/module-require/parent/'); +const child = require('../fixtures/module-require/child/'); assert.strictEqual(child.loaded, parent.loaded); // #1357 Loading JSON files with require() -var json = require('../fixtures/packages/main/package.json'); +const json = require('../fixtures/packages/main/package.json'); assert.deepStrictEqual(json, { name: 'package-name', version: '1.2.3', diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index 3ebf9db548..b40cfb400b 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); // this test only fails with CentOS 6.3 using kernel version 2.6.32 // On other linuxes and darwin, the `read` call gets an ECONNRESET in @@ -18,7 +18,7 @@ switch (process.argv[2]) { } function server() { - var net = require('net'); + const net = require('net'); var content = Buffer.alloc(64 * 1024 * 1024, '#'); net.createServer(function(socket) { this.close(); @@ -35,7 +35,7 @@ function server() { } function client() { - var net = require('net'); + const net = require('net'); var client = net.connect({ host: common.localhostIPv4, port: common.PORT @@ -45,7 +45,7 @@ function client() { } function parent() { - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var node = process.execPath; var s = spawn(node, [__filename, 'server'], { diff --git a/test/sequential/test-regress-GH-1726.js b/test/sequential/test-regress-GH-1726.js index c5f0bba133..0097ed913d 100644 --- a/test/sequential/test-regress-GH-1726.js +++ b/test/sequential/test-regress-GH-1726.js @@ -5,8 +5,8 @@ // https://github.com/joyent/node/issues/1726 require('../common'); -var assert = require('assert'); -var ch = require('child_process'); +const assert = require('assert'); +const ch = require('child_process'); var gen = +(process.argv[2] || 0); var maxGen = 5; diff --git a/test/sequential/test-regress-GH-4015.js b/test/sequential/test-regress-GH-4015.js index 7f0e03f9ac..87b2b8561d 100644 --- a/test/sequential/test-regress-GH-4015.js +++ b/test/sequential/test-regress-GH-4015.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var exec = require('child_process').exec; +const common = require('../common'); +const assert = require('assert'); +const exec = require('child_process').exec; var cmd = '"' + process.execPath + '" ' + '"' + common.fixturesDir + '/test-regress-GH-4015.js"'; diff --git a/test/sequential/test-regress-GH-4027.js b/test/sequential/test-regress-GH-4027.js index aa1ec12c30..7653dda182 100644 --- a/test/sequential/test-regress-GH-4027.js +++ b/test/sequential/test-regress-GH-4027.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); common.refreshTmpDir(); diff --git a/test/sequential/test-regress-GH-784.js b/test/sequential/test-regress-GH-784.js index 0c70337de7..645ffeb650 100644 --- a/test/sequential/test-regress-GH-784.js +++ b/test/sequential/test-regress-GH-784.js @@ -7,9 +7,9 @@ // The next two are made with server on - they should come back successful. // The next two are made with the server off - and so on. Without the fix // we were experiencing parse errors and instead of ECONNREFUSED. -var common = require('../common'); -var http = require('http'); -var assert = require('assert'); +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); var server = http.createServer(function(req, res) { diff --git a/test/sequential/test-regress-GH-877.js b/test/sequential/test-regress-GH-877.js index 5b0aac802e..82229524ce 100644 --- a/test/sequential/test-regress-GH-877.js +++ b/test/sequential/test-regress-GH-877.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var http = require('http'); -var assert = require('assert'); +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); var N = 20; var responses = 0; diff --git a/test/sequential/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index 0188b3b8c5..344845e020 100644 --- a/test/sequential/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -37,7 +37,7 @@ child.stdout.once('data', function() { function eeTest() { child.stdin.write('setTimeout(function() {\n' + - ' var events = require("events");\n' + + ' const events = require("events");\n' + ' var e = new events.EventEmitter;\n' + ' process.nextTick(function() {\n' + ' e.on("x", thrower);\n' + diff --git a/test/sequential/test-require-cache-without-stat.js b/test/sequential/test-require-cache-without-stat.js index 2571583f76..0549e5f72e 100644 --- a/test/sequential/test-require-cache-without-stat.js +++ b/test/sequential/test-require-cache-without-stat.js @@ -2,9 +2,9 @@ // We've experienced a regression where the module loader stats a bunch of // directories on require() even if it's been called before. The require() // should caching the request. -var common = require('../common'); -var fs = require('fs'); -var assert = require('assert'); +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); var counter = 0; diff --git a/test/sequential/test-stream2-fs.js b/test/sequential/test-stream2-fs.js index 7baba6e63b..3640749179 100644 --- a/test/sequential/test-stream2-fs.js +++ b/test/sequential/test-stream2-fs.js @@ -1,19 +1,19 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var fs = require('fs'); +const fs = require('fs'); var FSReadable = fs.ReadStream; -var path = require('path'); +const path = require('path'); var file = path.resolve(common.fixturesDir, 'x1024.txt'); var size = fs.statSync(file).size; var expectLengths = [1024]; -var util = require('util'); -var Stream = require('stream'); +const util = require('util'); +const Stream = require('stream'); util.inherits(TestWriter, Stream); diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index c7daaa6b08..2855a5f097 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -4,8 +4,8 @@ require('../common'); function parent() { - var spawn = require('child_process').spawn; - var assert = require('assert'); + const spawn = require('child_process').spawn; + const assert = require('assert'); var i = 0; children.forEach(function(_, c) { var child = spawn(process.execPath, [__filename, '' + c]); @@ -42,7 +42,7 @@ function child1() { // using a net socket function child2() { - var net = require('net'); + const net = require('net'); var socket = new net.Socket({ fd: 2, readable: false, diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index 1159278efa..c0e15c1436 100644 --- a/test/sequential/test-util-debug.js +++ b/test/sequential/test-util-debug.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); if (process.argv[2] === 'child') child(); @@ -24,7 +24,7 @@ function test(environ, shouldWrite) { } var expectOut = 'ok\n'; - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child'], { env: Object.assign(process.env, { NODE_DEBUG: environ }) }); @@ -53,7 +53,7 @@ function test(environ, shouldWrite) { function child() { - var util = require('util'); + const util = require('util'); var debug = util.debuglog('tud'); debug('this', { is: 'a' }, /debugging/); debug('number=%d string=%s obj=%j', 1234, 'asdf', { foo: 'bar' }); diff --git a/test/sequential/test-vm-timeout-rethrow.js b/test/sequential/test-vm-timeout-rethrow.js index f0f9c0b9c5..d55a9b310c 100644 --- a/test/sequential/test-vm-timeout-rethrow.js +++ b/test/sequential/test-vm-timeout-rethrow.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var vm = require('vm'); -var spawn = require('child_process').spawn; +const assert = require('assert'); +const vm = require('vm'); +const spawn = require('child_process').spawn; if (process.argv[2] === 'child') { var code = 'var j = 0;\n' + diff --git a/test/timers/test-timers-reliability.js b/test/timers/test-timers-reliability.js index 0626c45826..11dd0a225d 100644 --- a/test/timers/test-timers-reliability.js +++ b/test/timers/test-timers-reliability.js @@ -4,7 +4,7 @@ require('../common'); var Timer = process.binding('timer_wrap').Timer; -var assert = require('assert'); +const assert = require('assert'); var timerFired = false; var intervalFired = false; |