Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b726776

Browse files
mithunsasidharangibfahn
authored andcommittedDec 20, 2017
test: refactored to remove unnecessary variables
PR-URL: #17553 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 042ae4a commit b726776

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎test/parallel/test-net-connect-options-fd.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS);
8383
path: serverPath
8484
});
8585
const getConnectCb = (index) => common.mustCall(function clientOnConnect() {
86-
const client = this;
8786
// Test if it's wrapping an existing fd
8887
assert(handleMap.has(index));
8988
const oldHandle = handleMap.get(index);
9089
assert.strictEqual(oldHandle.fd, this._handle.fd);
91-
client.write(String(oldHandle.fd));
90+
this.write(String(oldHandle.fd));
9291
console.error(`[Pipe]Sending data through fd ${oldHandle.fd}`);
93-
client.on('error', function(err) {
92+
this.on('error', function(err) {
9493
console.error(err);
9594
assert.fail(null, null, `[Pipe Client]${err}`);
9695
});

‎test/parallel/test-net-connect-options-path.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ const CLIENT_VARIANTS = 12;
2020
}, CLIENT_VARIANTS))
2121
.listen(serverPath, common.mustCall(function() {
2222
const getConnectCb = () => common.mustCall(function() {
23-
const client = this;
24-
client.end();
25-
client.on('close', common.mustCall(function() {
23+
this.end();
24+
this.on('close', common.mustCall(function() {
2625
counter++;
2726
if (counter === CLIENT_VARIANTS) {
2827
server.close();

0 commit comments

Comments
 (0)
Please sign in to comment.