binding this is better for garbage collection.

This commit is contained in:
Brandon Nozaki Miller 2017-05-18 14:22:56 -07:00 committed by GitHub
parent f6bd9e7832
commit fdfd13b98f

View file

@ -259,7 +259,6 @@ function serverCreated(socket) {
} }
function startServer() { function startServer() {
var self = this;
this.log( this.log(
'starting server on ',this.path, 'starting server on ',this.path,
((this.port)?`:${this.port}`:'') ((this.port)?`:${this.port}`:'')
@ -290,13 +289,13 @@ function startServer() {
this.server.on( this.server.on(
'error', 'error',
function(err){ function(err){
self.log('server error',err); this.log('server error',err);
self.publish( this.publish(
'error', 'error',
err err
); );
} }.bind(this)
); );
this.server.maxConnections=this.config.maxConnections; this.server.maxConnections=this.config.maxConnections;