Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
net: name anonymous functions in net module
the changes are related to Ref: #8913
regarding the naming of just the inline anonymous
functions that are not assigned to a variable
  • Loading branch information
pvsousalima committed Nov 1, 2016
commit 2321c4c2e49bceace34a3baa6fdb59cab2f3fb4d
10 changes: 5 additions & 5 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function onSocketEnd() {
this.readable = false;
maybeDestroy(this);
} else {
this.once('end', function() {
this.once('end', function end() {
this.readable = false;
maybeDestroy(this);
});
Expand Down Expand Up @@ -669,7 +669,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
if (this.connecting) {
this._pendingData = data;
this._pendingEncoding = encoding;
this.once('connect', function() {
this.once('connect', function connect() {
this._writeGeneric(writev, data, encoding, cb);
});
return;
Expand Down Expand Up @@ -991,7 +991,7 @@ function lookupAndConnect(self, options) {
debug('connect: dns options', dnsopts);
self._host = host;
var lookup = options.lookup || dns.lookup;
lookup(host, dnsopts, function(err, ip, addressType) {
lookup(host, dnsopts, function emitLookup(err, ip, addressType) {
self.emit('lookup', err, ip, addressType, host);

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

function lookupAndListen(self, port, address, backlog, exclusive) {
require('dns').lookup(address, function(err, ip, addressType) {
require('dns').lookup(address, function emitLookup(err, ip, addressType) {
if (err) {
self.emit('error', err);
} else {
Expand Down Expand Up @@ -1494,7 +1494,7 @@ Server.prototype.close = function(cb) {

if (typeof cb === 'function') {
if (!this._handle) {
this.once('close', function() {
this.once('close', function close() {
cb(new Error('Not running'));
});
} else {
Expand Down