Skip to content

Commit d09eb9c

Browse files
pvsousalimaevanlucas
authored andcommitted
net: name anonymous functions
the changes are related #8913 regarding the naming of just the inline anonymous functions that are not assigned to a variable PR-URL: #9357 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent e451022 commit d09eb9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/net.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function onSocketEnd() {
269269
this.readable = false;
270270
maybeDestroy(this);
271271
} else {
272-
this.once('end', function() {
272+
this.once('end', function end() {
273273
this.readable = false;
274274
maybeDestroy(this);
275275
});
@@ -669,7 +669,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
669669
if (this.connecting) {
670670
this._pendingData = data;
671671
this._pendingEncoding = encoding;
672-
this.once('connect', function() {
672+
this.once('connect', function connect() {
673673
this._writeGeneric(writev, data, encoding, cb);
674674
});
675675
return;
@@ -991,7 +991,7 @@ function lookupAndConnect(self, options) {
991991
debug('connect: dns options', dnsopts);
992992
self._host = host;
993993
var lookup = options.lookup || dns.lookup;
994-
lookup(host, dnsopts, function(err, ip, addressType) {
994+
lookup(host, dnsopts, function emitLookup(err, ip, addressType) {
995995
self.emit('lookup', err, ip, addressType, host);
996996

997997
// It's possible we were destroyed while looking this up.
@@ -1389,7 +1389,7 @@ Server.prototype.listen = function() {
13891389
};
13901390

13911391
function lookupAndListen(self, port, address, backlog, exclusive) {
1392-
require('dns').lookup(address, function(err, ip, addressType) {
1392+
require('dns').lookup(address, function doListening(err, ip, addressType) {
13931393
if (err) {
13941394
self.emit('error', err);
13951395
} else {
@@ -1494,7 +1494,7 @@ Server.prototype.close = function(cb) {
14941494

14951495
if (typeof cb === 'function') {
14961496
if (!this._handle) {
1497-
this.once('close', function() {
1497+
this.once('close', function close() {
14981498
cb(new Error('Not running'));
14991499
});
15001500
} else {

0 commit comments

Comments
 (0)