diff --git a/test/parallel/test-buffer-fakes.js b/test/parallel/test-buffer-fakes.js index 5804cbba30..1a1d9c0c49 100644 --- a/test/parallel/test-buffer-fakes.js +++ b/test/parallel/test-buffer-fakes.js @@ -3,7 +3,6 @@ require('../common'); const assert = require('assert'); const Buffer = require('buffer').Buffer; -const Bp = Buffer.prototype; function FakeBuffer() { } FakeBuffer.__proto__ = Buffer; diff --git a/test/parallel/test-child-process-exec-buffer.js b/test/parallel/test-child-process-exec-buffer.js index b9727f0c63..a381af9631 100644 --- a/test/parallel/test-child-process-exec-buffer.js +++ b/test/parallel/test-child-process-exec-buffer.js @@ -18,7 +18,7 @@ exec('echo ' + str, function(err, stdout, stderr) { }); // no encoding (Buffers expected) -var child = exec('echo ' + str, { +exec('echo ' + str, { encoding: null }, function(err, stdout, stderr) { assert.ok(stdout instanceof Buffer, 'Expected stdout to be a Buffer'); diff --git a/test/parallel/test-cluster-http-pipe.js b/test/parallel/test-cluster-http-pipe.js index 4c6dee347b..cb9b090f08 100644 --- a/test/parallel/test-cluster-http-pipe.js +++ b/test/parallel/test-cluster-http-pipe.js @@ -34,7 +34,6 @@ http.createServer(function(req, res) { res.writeHead(200); res.end('OK'); }).listen(common.PIPE, function() { - var self = this; http.get({ socketPath: common.PIPE, path: '/' }, function(res) { res.resume(); res.on('end', function(err) { diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 806f5de18b..c4b8990beb 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -20,7 +20,6 @@ var fs = require('fs'); var path = require('path'); // Test Certificates -var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii'); var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); var certPfx = fs.readFileSync(common.fixturesDir + '/test_cert.pfx'); var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii'); diff --git a/test/parallel/test-debug-signal-cluster.js b/test/parallel/test-debug-signal-cluster.js index 6572ef50af..7a950458b8 100644 --- a/test/parallel/test-debug-signal-cluster.js +++ b/test/parallel/test-debug-signal-cluster.js @@ -10,7 +10,6 @@ var options = { stdio: ['inherit', 'inherit', 'pipe', 'ipc'] }; var child = spawn(process.execPath, args, options); var outputLines = []; -var outputTimerId; var waitingForDebuggers = false; var pids = null; diff --git a/test/parallel/test-dgram-error-message-address.js b/test/parallel/test-dgram-error-message-address.js index e307a23e24..005695654f 100644 --- a/test/parallel/test-dgram-error-message-address.js +++ b/test/parallel/test-dgram-error-message-address.js @@ -20,7 +20,6 @@ socket_ipv4.bind(common.PORT, '1.1.1.1'); // IPv6 Test var socket_ipv6 = dgram.createSocket('udp6'); -var family_ipv6 = 'IPv6'; socket_ipv6.on('listening', common.fail); diff --git a/test/parallel/test-dgram-pingpong.js b/test/parallel/test-dgram-pingpong.js index 29ab92757b..883085a9cd 100644 --- a/test/parallel/test-dgram-pingpong.js +++ b/test/parallel/test-dgram-pingpong.js @@ -11,7 +11,6 @@ function pingPongTest(port, host) { var callbacks = 0; var N = 500; var count = 0; - var sent_final_ping = false; var server = dgram.createSocket('udp4', function(msg, rinfo) { if (debug) console.log('server got: ' + msg + @@ -48,7 +47,6 @@ function pingPongTest(port, host) { if (count < N) { client.send(buf, 0, buf.length, port, 'localhost'); } else { - sent_final_ping = true; client.send(buf, 0, buf.length, port, 'localhost', function() { client.close(); }); diff --git a/test/parallel/test-domain-http-server.js b/test/parallel/test-domain-http-server.js index 99dbf413e3..37dbc30f42 100644 --- a/test/parallel/test-domain-http-server.js +++ b/test/parallel/test-domain-http-server.js @@ -9,7 +9,6 @@ objects.baz.asdf = objects; var serverCaught = 0; var clientCaught = 0; -var disposeEmit = 0; var server = http.createServer(function(req, res) { var dom = domain.create(); diff --git a/test/parallel/test-domain-implicit-fs.js b/test/parallel/test-domain-implicit-fs.js index f35647b525..f2d5c3800b 100644 --- a/test/parallel/test-domain-implicit-fs.js +++ b/test/parallel/test-domain-implicit-fs.js @@ -9,7 +9,6 @@ var caught = 0; var expectCaught = 1; var d = new domain.Domain(); -var e = new events.EventEmitter(); d.on('error', function(er) { console.error('caught', er); diff --git a/test/parallel/test-domain-uncaught-exception.js b/test/parallel/test-domain-uncaught-exception.js index 8792eb1ce5..35632dbf53 100644 --- a/test/parallel/test-domain-uncaught-exception.js +++ b/test/parallel/test-domain-uncaught-exception.js @@ -13,8 +13,6 @@ const assert = require('assert'); const domain = require('domain'); const child_process = require('child_process'); -const uncaughtExceptions = {}; - const tests = []; function test1() { 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 1c4c7cd808..55133ba673 100644 --- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js +++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js @@ -31,7 +31,6 @@ const domainErrHandlerExMessage = 'exception from domain error handler'; if (process.argv[2] === 'child') { var domain = require('domain'); var d = domain.create(); - var triggeredProcessUncaughtException = false; process.on('uncaughtException', function onUncaughtException() { // The process' uncaughtException event must not be emitted when @@ -116,17 +115,7 @@ if (process.argv[2] === 'child') { var child = exec(cmdToExec); if (child) { - var childTriggeredOnUncaughtExceptionHandler = false; - child.on('message', function onChildMsg(msg) { - if (msg === 'triggeredProcessUncaughtEx') { - childTriggeredOnUncaughtExceptionHandler = true; - } - }); - child.on('exit', function onChildExited(exitCode, signal) { - var expectedExitCodes; - var expectedSignals; - // When throwing errors from the top-level domain error handler // outside of a try/catch block, the process should not exit gracefully if (!options.useTryCatch && options.throwInDomainErrHandler) { diff --git a/test/parallel/test-dsa-fips-invalid-key.js b/test/parallel/test-dsa-fips-invalid-key.js index 0b5773411e..2d30ef6891 100644 --- a/test/parallel/test-dsa-fips-invalid-key.js +++ b/test/parallel/test-dsa-fips-invalid-key.js @@ -12,8 +12,6 @@ var fs = require('fs'); var input = 'hello'; -var dsapub = fs.readFileSync(common.fixturesDir + - '/keys/dsa_public_1025.pem'); var dsapri = fs.readFileSync(common.fixturesDir + '/keys/dsa_private_1025.pem'); var sign = crypto.createSign('DSS1'); diff --git a/test/parallel/test-eval.js b/test/parallel/test-eval.js index d3a83fbd5a..59b5d1a240 100644 --- a/test/parallel/test-eval.js +++ b/test/parallel/test-eval.js @@ -10,7 +10,7 @@ var error_count = 0; var cmd = ['"' + process.execPath + '"', '-e', '"console.error(process.argv)"', 'foo', 'bar'].join(' '); var expected = util.format([process.execPath, 'foo', 'bar']) + '\n'; -var child = exec(cmd, function(err, stdout, stderr) { +exec(cmd, function(err, stdout, stderr) { if (err) { console.log(err.toString()); ++error_count; diff --git a/test/parallel/test-event-emitter-remove-listeners.js b/test/parallel/test-event-emitter-remove-listeners.js index 8993aadf51..396979a923 100644 --- a/test/parallel/test-event-emitter-remove-listeners.js +++ b/test/parallel/test-event-emitter-remove-listeners.js @@ -15,11 +15,6 @@ function listener2() { count++; } -function listener3() { - console.log('listener3'); - count++; -} - function remove1() { assert(0); } diff --git a/test/parallel/test-file-write-stream3.js b/test/parallel/test-file-write-stream3.js index 6ed852eb00..a2552d95b2 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -124,7 +124,7 @@ function run_test_2() { function run_test_3() { - var file, buffer, options; + var file, options; var data = '\u2026\u2026', // 3 bytes * 2 = 6 bytes in UTF-8 fileData; @@ -167,7 +167,7 @@ function run_test_3() { function run_test_4() { - var file, options; + var options; options = { start: -5, flags: 'r+' }; diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index b53a823603..667abb8176 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -7,14 +7,9 @@ var fs = require('fs'); var O_APPEND = constants.O_APPEND || 0; var O_CREAT = constants.O_CREAT || 0; -var O_DIRECTORY = constants.O_DIRECTORY || 0; var O_EXCL = constants.O_EXCL || 0; -var O_NOCTTY = constants.O_NOCTTY || 0; -var O_NOFOLLOW = constants.O_NOFOLLOW || 0; var O_RDONLY = constants.O_RDONLY || 0; var O_RDWR = constants.O_RDWR || 0; -var O_SYMLINK = constants.O_SYMLINK || 0; -var O_SYNC = constants.O_SYNC || 0; var O_TRUNC = constants.O_TRUNC || 0; var O_WRONLY = constants.O_WRONLY || 0; diff --git a/test/parallel/test-fs-open.js b/test/parallel/test-fs-open.js index 0a069b9a0b..0818f2b7f6 100644 --- a/test/parallel/test-fs-open.js +++ b/test/parallel/test-fs-open.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var constants = require('constants'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-read-buffer-tostring-fail.js b/test/parallel/test-fs-read-buffer-tostring-fail.js index 3ec1491d2b..f00df61ea7 100644 --- a/test/parallel/test-fs-read-buffer-tostring-fail.js +++ b/test/parallel/test-fs-read-buffer-tostring-fail.js @@ -6,7 +6,6 @@ const fs = require('fs'); const path = require('path'); const Buffer = require('buffer').Buffer; const kStringMaxLength = process.binding('buffer').kStringMaxLength; -const kMaxLength = process.binding('buffer').kMaxLength; var fd; diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index 2ad6cea437..5d5cb40ec1 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -48,7 +48,7 @@ function expect_ok(syscall, resource, err, atime, mtime) { // would be even better though (node doesn't have such functionality yet) function runTest(atime, mtime, callback) { - var fd, err; + var fd; // // test synchronized code paths, these functions throw on failure // diff --git a/test/parallel/test-fs-write-file-sync.js b/test/parallel/test-fs-write-file-sync.js index 72c0a2b19b..7ae9e122ca 100644 --- a/test/parallel/test-fs-write-file-sync.js +++ b/test/parallel/test-fs-write-file-sync.js @@ -15,7 +15,7 @@ fs._closeSync = fs.closeSync; fs.closeSync = closeSync; // Reset the umask for testing -var mask = process.umask(0o000); +process.umask(0o000); // On Windows chmod is only able to manipulate read-only bit. Test if creating // the file in read-only mode works. diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index c1d92c7818..f30ad1d218 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -82,7 +82,6 @@ child_process.exec(nodeBinary + ' ' }); // https://github.com/nodejs/node/issues/1691 -var originalCwd = process.cwd(); process.chdir(path.join(__dirname, '../fixtures/')); child_process.exec(nodeBinary + ' ' + '--expose_debug_as=v8debug ' diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js index e229bada3a..5e7739daa5 100644 --- a/test/parallel/test-promises-unhandled-rejections.js +++ b/test/parallel/test-promises-unhandled-rejections.js @@ -185,12 +185,11 @@ asyncTest('When re-throwing new errors in a promise catch, only the' + asyncTest('Test params of unhandledRejection for a synchronously-rejected' + 'promise', function(done) { var e = new Error(); - var e2 = new Error(); onUnhandledSucceed(done, function(reason, promise) { assert.strictEqual(e, reason); assert.strictEqual(promise, promise); }); - var promise = Promise.reject(e); + Promise.reject(e); }); asyncTest('When re-throwing new errors in a promise catch, only the ' + @@ -629,7 +628,7 @@ asyncTest('Promise unhandledRejection handler does not interfere with domain' + assert.strictEqual(domainReceivedError, domainError); d.dispose(); }); - var a = Promise.reject(e); + Promise.reject(e); process.nextTick(function() { throw domainError; }); diff --git a/test/parallel/test-readline-undefined-columns.js b/test/parallel/test-readline-undefined-columns.js index 73945af8bc..24f138f46b 100644 --- a/test/parallel/test-readline-undefined-columns.js +++ b/test/parallel/test-readline-undefined-columns.js @@ -11,7 +11,7 @@ const readline = require('readline'); const iStream = new PassThrough(); const oStream = new PassThrough(); -const rli = readline.createInterface({ +readline.createInterface({ terminal: true, input: iStream, output: oStream, diff --git a/test/parallel/test-regress-GH-4256.js b/test/parallel/test-regress-GH-4256.js index 1a4a78b3c0..a312fb277f 100644 --- a/test/parallel/test-regress-GH-4256.js +++ b/test/parallel/test-regress-GH-4256.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); process.domain = null; -var timer = setTimeout(function() { +setTimeout(function() { console.log('this console.log statement should not make node crash'); }, 1); diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index 05cc299f56..15f779d3b1 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -8,7 +8,7 @@ var repl = require('repl'); common.globalCheck = false; const putIn = new common.ArrayStream(); -var testMe = repl.start('', putIn, null, true); +repl.start('', putIn, null, true); test1(); diff --git a/test/parallel/test-repl-syntax-error-stack.js b/test/parallel/test-repl-syntax-error-stack.js index 11e335e285..ebf0b2e4d8 100644 --- a/test/parallel/test-repl-syntax-error-stack.js +++ b/test/parallel/test-repl-syntax-error-stack.js @@ -16,7 +16,7 @@ common.ArrayStream.prototype.write = function(output) { }; const putIn = new common.ArrayStream(); -const testMe = repl.start('', putIn); +repl.start('', putIn); let file = path.resolve(__dirname, '../fixtures/syntax/bad_syntax'); if (common.isWindows) diff --git a/test/parallel/test-stream-pipe-error-handling.js b/test/parallel/test-stream-pipe-error-handling.js index 8b674bffbd..88a70fb58e 100644 --- a/test/parallel/test-stream-pipe-error-handling.js +++ b/test/parallel/test-stream-pipe-error-handling.js @@ -38,7 +38,6 @@ var Stream = require('stream').Stream; })(); (function testErrorWithRemovedListenerThrows() { - var EE = require('events').EventEmitter; var R = Stream.Readable; var W = Stream.Writable; @@ -73,7 +72,6 @@ var Stream = require('stream').Stream; })(); (function testErrorWithRemovedListenerThrows() { - var EE = require('events').EventEmitter; var R = Stream.Readable; var W = Stream.Writable; diff --git a/test/parallel/test-stream-push-order.js b/test/parallel/test-stream-push-order.js index 0bbcdf522b..f09cf95f37 100644 --- a/test/parallel/test-stream-push-order.js +++ b/test/parallel/test-stream-push-order.js @@ -21,7 +21,7 @@ s._read = function(n) { } }; -var v = s.read(0); +s.read(0); // ACTUALLY [1, 3, 5, 6, 4, 2] diff --git a/test/parallel/test-stream-unshift-read-race.js b/test/parallel/test-stream-unshift-read-race.js index 253427e391..8239a380de 100644 --- a/test/parallel/test-stream-unshift-read-race.js +++ b/test/parallel/test-stream-unshift-read-race.js @@ -13,7 +13,6 @@ var stream = require('stream'); var hwm = 10; var r = stream.Readable({ highWaterMark: hwm }); var chunks = 10; -var t = (chunks * 5); var data = new Buffer(chunks * hwm + Math.ceil(hwm / 2)); for (var i = 0; i < data.length; i++) { diff --git a/test/parallel/test-stream-writev.js b/test/parallel/test-stream-writev.js index 88933508fb..5b07dd1119 100644 --- a/test/parallel/test-stream-writev.js +++ b/test/parallel/test-stream-writev.js @@ -30,11 +30,9 @@ function test(decode, uncork, multi, next) { function cnt(msg) { expectCount++; var expect = expectCount; - var called = false; return function(er) { if (er) throw er; - called = true; counter++; assert.equal(counter, expect); }; diff --git a/test/parallel/test-stream2-compatibility.js b/test/parallel/test-stream2-compatibility.js index 76cb594229..2d62d63907 100644 --- a/test/parallel/test-stream2-compatibility.js +++ b/test/parallel/test-stream2-compatibility.js @@ -5,7 +5,6 @@ var W = require('_stream_writable'); var assert = require('assert'); var util = require('util'); -var EE = require('events').EventEmitter; var ondataCalled = 0; diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 84457c7e3e..6a38baac5d 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/test/parallel/test-stream2-large-read-stall.js @@ -53,9 +53,6 @@ function push() { setTimeout(push); } -// start the flow -var ret = r.read(0); - process.on('exit', function() { assert.equal(pushes, PUSHCOUNT + 1); assert(endEmitted); diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index e79b8f9524..e67359eff2 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -167,8 +167,6 @@ test('read(0) for object streams', function(t) { r.push('foobar'); r.push(null); - var v = r.read(0); - r.pipe(toArray(function(array) { assert.deepEqual(array, ['foobar']); diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index d4b42b60af..ab9d9c5d72 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -39,8 +39,6 @@ process.nextTick(run); test('buffers', function(t) { - // have a length - var len = 16; var list = [ new Buffer('foog'), new Buffer('bark'), new Buffer('bazy'), @@ -69,8 +67,6 @@ test('buffers', function(t) { }); test('strings', function(t) { - // have a length - var len = 16; var list = [ 'foog', 'bark', 'bazy', diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 7dad573483..11ee45915c 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -303,13 +303,10 @@ test('passthrough event emission', function(t) { var pt = new PassThrough(); var emits = 0; pt.on('readable', function() { - var state = pt._readableState; console.error('>>> emit readable %d', emits); emits++; }); - var i = 0; - pt.write(new Buffer('foog')); console.error('need emit 0'); diff --git a/test/parallel/test-timers-ordering.js b/test/parallel/test-timers-ordering.js index 5da88967e3..cef91e58e7 100644 --- a/test/parallel/test-timers-ordering.js +++ b/test/parallel/test-timers-ordering.js @@ -3,13 +3,10 @@ require('../common'); var assert = require('assert'); var Timer = process.binding('timer_wrap').Timer; -var i; - var N = 30; var last_i = 0; var last_ts = 0; -var start = Timer.now(); var f = function(i) { if (i <= N) { diff --git a/test/parallel/test-timers-zero-timeout.js b/test/parallel/test-timers-zero-timeout.js index 78445ac659..ab0c38f608 100644 --- a/test/parallel/test-timers-zero-timeout.js +++ b/test/parallel/test-timers-zero-timeout.js @@ -7,7 +7,7 @@ var assert = require('assert'); var ncalled = 0; setTimeout(f, 0, 'foo', 'bar', 'baz'); - var timer = setTimeout(function() {}, 0); + setTimeout(function() {}, 0); function f(a, b, c) { assert.equal(a, 'foo'); diff --git a/test/parallel/test-url.js b/test/parallel/test-url.js index a912b43d82..cd097be243 100644 --- a/test/parallel/test-url.js +++ b/test/parallel/test-url.js @@ -1514,9 +1514,6 @@ relativeTests2.forEach(function(relativeTest) { //if format and parse are inverse operations then //resolveObject(parse(x), y) == parse(resolve(x, y)) -//host and hostname are special, in this case a '' value is important -var emptyIsImportant = {'host': true, 'hostname': ''}; - //format: [from, path, expected] relativeTests.forEach(function(relativeTest) { var actual = url.resolveObject(url.parse(relativeTest[0]), relativeTest[1]),