Skip to content

Commit 2f4538d

Browse files
TrottMyles Borins
authored andcommitted
test: remove unused vars
Remove unused vars in tests PR-URL: #4536 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a1a0a0 commit 2f4538d

23 files changed

+23
-44
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 8 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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-vm-create-context-arg.js

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 1 deletion
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);

0 commit comments

Comments
 (0)