diff --git a/lib/net.js b/lib/net.js index 6c475619117dc5..d3b3a18e269537 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1416,8 +1416,7 @@ Server.prototype.listen = function(...args) { throw new ERR_SERVER_ALREADY_LISTEN(); } - var hasCallback = (cb !== null); - if (hasCallback) { + if (cb !== null) { this.once('listening', cb); } var backlogFromArgs =