Skip to content

Commit 4b14f1c

Browse files
TrottFishrock123
authored andcommitted
test: remove unused vars
Remove unused vars in tests PR-URL: #4536 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Conflicts: test/parallel/test-timers-throw-when-cb-not-function.js
1 parent 5be0259 commit 4b14f1c

23 files changed

+23
-44
lines changed

test/addons/repl-domain-abort/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ var options = {
4646
};
4747

4848
// Run commands from fake REPL.
49-
var dummy = repl.start(options);
49+
repl.start(options);

test/debugger/test-debugger-pid.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
'use strict';
2-
var common = require('../common');
2+
require('../common');
33
var assert = require('assert');
44
var spawn = require('child_process').spawn;
55

6-
var port = common.PORT + 1337;
76
var buffer = '';
8-
var expected = [];
9-
var scriptToDebug = common.fixturesDir + '/empty.js';
10-
11-
function fail() {
12-
assert(0); // `--debug-brk script.js` should not quit
13-
}
147

158
// connect to debug agent
169
var interfacer = spawn(process.execPath, ['debug', '-p', '655555']);

test/debugger/test-debugger-remote.js

-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ var common = require('../common');
33
var assert = require('assert');
44
var spawn = require('child_process').spawn;
55

6-
var port = common.PORT + 1337;
76
var buffer = '';
8-
var expected = [];
97
var scriptToDebug = common.fixturesDir + '/empty.js';
108

119
function fail() {

test/internet/test-dns.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ require('../common');
33
var assert = require('assert'),
44
dns = require('dns'),
55
net = require('net'),
6-
isIP = net.isIP,
76
isIPv4 = net.isIPv4,
87
isIPv6 = net.isIPv6;
98
var util = require('util');
@@ -48,7 +47,7 @@ TEST(function test_reverse_bogus(done) {
4847
var error;
4948

5049
try {
51-
var req = dns.reverse('bogus ip', function() {
50+
dns.reverse('bogus ip', function() {
5251
assert.ok(false);
5352
});
5453
} catch (e) {
@@ -369,7 +368,7 @@ console.log('looking up nodejs.org...');
369368

370369
var cares = process.binding('cares_wrap');
371370
var req = new cares.GetAddrInfoReqWrap();
372-
var err = cares.getaddrinfo(req, 'nodejs.org', 4);
371+
cares.getaddrinfo(req, 'nodejs.org', 4);
373372

374373
req.oncomplete = function(err, domains) {
375374
assert.strictEqual(err, 0);

test/parallel/test-domain-exit-dispose-again.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// to that domain, including those whose callbacks are called from within
66
// the same invocation of listOnTimeout, _are_ called.
77

8-
var common = require('../common');
8+
require('../common');
99
var assert = require('assert');
1010
var domain = require('domain');
1111
var disposalFailed = false;

test/parallel/test-domain-implicit-fs.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require('../common');
55
var assert = require('assert');
66
var domain = require('domain');
7-
var events = require('events');
87
var caught = 0;
98
var expectCaught = 1;
109

test/parallel/test-http-agent-error-on-idle.js

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function get(callback) {
2121
return http.get(requestParams, callback);
2222
}
2323

24-
var destroy_queue = {};
2524
var server = http.createServer(function(req, res) {
2625
res.end('hello world');
2726
});

test/parallel/test-vm-create-context-arg.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ var assert = require('assert');
44
var vm = require('vm');
55

66
assert.throws(function() {
7-
var ctx = vm.createContext('string is not supported');
7+
vm.createContext('string is not supported');
88
}, TypeError);
99

1010
assert.doesNotThrow(function() {
11-
var ctx = vm.createContext({ a: 1 });
12-
ctx = vm.createContext([0, 1, 2, 3]);
11+
vm.createContext({ a: 1 });
12+
vm.createContext([0, 1, 2, 3]);
1313
});
1414

1515
assert.doesNotThrow(function() {

test/parallel/test-vm-harmony-proxies.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ var vm = require('vm');
88
// src/node_contextify.cc filters out the Proxy object from the parent
99
// context. Make sure that the new context has a Proxy object of its own.
1010
var sandbox = {};
11-
var result = vm.runInNewContext('this.Proxy = Proxy', sandbox);
11+
vm.runInNewContext('this.Proxy = Proxy', sandbox);
1212
assert(typeof sandbox.Proxy === 'object');
1313
assert(sandbox.Proxy !== Proxy);
1414

1515
// Unless we copy the Proxy object explicitly, of course.
1616
var sandbox = { Proxy: Proxy };
17-
var result = vm.runInNewContext('this.Proxy = Proxy', sandbox);
17+
vm.runInNewContext('this.Proxy = Proxy', sandbox);
1818
assert(typeof sandbox.Proxy === 'object');
1919
assert(sandbox.Proxy === Proxy);

test/parallel/test-vm-harmony-symbols.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ var vm = require('vm');
55

66
// The sandbox should have its own Symbol constructor.
77
var sandbox = {};
8-
var result = vm.runInNewContext('this.Symbol = Symbol', sandbox);
8+
vm.runInNewContext('this.Symbol = Symbol', sandbox);
99
assert(typeof sandbox.Symbol === 'function');
1010
assert(sandbox.Symbol !== Symbol);
1111

1212
// Unless we copy the Symbol constructor explicitly, of course.
1313
var sandbox = { Symbol: Symbol };
14-
var result = vm.runInNewContext('this.Symbol = Symbol', sandbox);
14+
vm.runInNewContext('this.Symbol = Symbol', sandbox);
1515
assert(typeof sandbox.Symbol === 'function');
1616
assert(sandbox.Symbol === Symbol);

test/parallel/test-vm-new-script-new-context.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ assert.throws(function() {
2121

2222

2323
console.error('undefined reference');
24-
var error;
2524
script = new Script('foo.bar = 5;');
2625
assert.throws(function() {
2726
script.runInNewContext();
@@ -41,7 +40,9 @@ code = 'foo = 1;' +
4140
foo = 2;
4241
obj = { foo: 0, baz: 3 };
4342
script = new Script(code);
43+
/* eslint-disable no-unused-vars */
4444
var baz = script.runInNewContext(obj);
45+
/* eslint-enable no-unused-vars */
4546
assert.equal(1, obj.foo);
4647
assert.equal(2, obj.bar);
4748
assert.equal(2, foo);

test/parallel/test-vm-run-in-new-context.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ code = 'foo = 1;' +
2929
'if (baz !== 3) throw new Error(\'test fail\');';
3030
foo = 2;
3131
obj = { foo: 0, baz: 3 };
32+
/* eslint-disable no-unused-vars */
3233
var baz = vm.runInNewContext(code, obj);
34+
/* eslint-enable no-unused-vars */
3335
assert.equal(1, obj.foo);
3436
assert.equal(2, obj.bar);
3537
assert.equal(2, foo);

test/parallel/test-vm-static-this.js

+2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ code = 'foo = 1;' +
2525
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
2626
foo = 2;
2727
obj = { foo: 0, baz: 3 };
28+
/* eslint-disable no-unused-vars */
2829
var baz = vm.runInThisContext(code);
30+
/* eslint-enable no-unused-vars */
2931
assert.equal(0, obj.foo);
3032
assert.equal(2, bar);
3133
assert.equal(1, foo);

test/pummel/test-dtrace-jsstack.js

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ var doogle = function() {
3232
};
3333

3434
var spawn = require('child_process').spawn;
35-
var prefix = '/var/tmp/node';
3635

3736
/*
3837
* We're going to use DTrace to stop us, gcore us, and set us running again

test/pummel/test-fs-watch-file.js

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var watchSeenTwo = 0;
99
var watchSeenThree = 0;
1010
var watchSeenFour = 0;
1111

12-
var startDir = process.cwd();
1312
var testDir = common.tmpDir;
1413

1514
var filenameOne = 'watch.txt';

test/pummel/test-https-no-reader.js

-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ var options = {
1818
};
1919

2020
var buf = new Buffer(1024 * 1024);
21-
var sent = 0;
22-
var received = 0;
2321

2422
var server = https.createServer(options, function(req, res) {
2523
res.writeHead(200);
@@ -30,7 +28,6 @@ var server = https.createServer(options, function(req, res) {
3028
});
3129

3230
server.listen(common.PORT, function() {
33-
var resumed = false;
3431
var req = https.request({
3532
method: 'POST',
3633
port: common.PORT,

test/pummel/test-regress-GH-892.js

-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ var https = require('https');
1717

1818
var fs = require('fs');
1919

20-
var PORT = 8000;
21-
22-
2320
var bytesExpected = 1024 * 1024 * 32;
24-
var gotResponse = false;
2521

2622
var started = false;
2723

test/pummel/test-stream2-basic.js

-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ test('pipe', function(t) {
157157
'xxxxx' ];
158158

159159
var w = new TestWriter();
160-
var flush = true;
161160

162161
w.on('end', function(received) {
163162
t.same(received, expect);
@@ -439,7 +438,6 @@ test('adding readable triggers data flow', function(t) {
439438
r.push(new Buffer('asdf'));
440439
};
441440

442-
var called = false;
443441
r.on('readable', function() {
444442
onReadable = true;
445443
r.read();

test/pummel/test-timers.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ function t() {
9191
expectedTimeouts--;
9292
}
9393

94-
var w = setTimeout(t, 200);
95-
var x = setTimeout(t, 200);
94+
setTimeout(t, 200);
95+
setTimeout(t, 200);
9696
var y = setTimeout(t, 200);
9797

9898
clearTimeout(y);
99-
var z = setTimeout(t, 200);
99+
setTimeout(t, 200);
100100
clearTimeout(y);
101101

102102

test/pummel/test-watch-file.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var fs = require('fs');
66
var path = require('path');
77

88
var f = path.join(common.fixturesDir, 'x.txt');
9-
var f2 = path.join(common.fixturesDir, 'x2.txt');
109

1110
console.log('watching for changes of ' + f);
1211

test/sequential/test-stream2-fs.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
var common = require('../common');
3-
var R = require('_stream_readable');
43
var assert = require('assert');
54

65
var fs = require('fs');
@@ -41,7 +40,6 @@ var w = new TestWriter();
4140
w.on('results', function(res) {
4241
console.error(res, w.length);
4342
assert.equal(w.length, size);
44-
var l = 0;
4543
assert.deepEqual(res.map(function(c) {
4644
return c.length;
4745
}), expectLengths);

test/sequential/test-tcp-wrap-listen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ assert.equal(0, r);
1212

1313
server.listen(128);
1414

15-
var slice, sliceCount = 0, eofCount = 0;
15+
var sliceCount = 0, eofCount = 0;
1616

1717
var writeCount = 0;
1818
var recvCount = 0;

test/timers/test-timers-reliability.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ monoTimer.ontimeout = function() {
4444

4545
monoTimer.start(300, 0);
4646

47-
var timer = setTimeout(function() {
47+
setTimeout(function() {
4848
timerFired = true;
4949
}, 200);
5050

0 commit comments

Comments
 (0)