| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -134,7 +134,7 @@ function replaceHandle(self, newHandle) { | |||
| 134 | 134 | self._handle = newHandle; | |
| 135 | 135 | } | |
| 136 | 136 | ||
| 137 | - Socket.prototype.bind = function(port_ /*, address, callback*/) { | ||
| 137 | + Socket.prototype.bind = function(port_, address_ /*, callback*/) { | ||
| 138 | 138 | var self = this; | |
| 139 | 139 | let port = port_; | |
| 140 | 140 | ||
@@ -145,7 +145,7 @@ Socket.prototype.bind = function(port_ /*, address, callback*/) { | |||
| 145 | 145 | ||
| 146 | 146 | this._bindState = BIND_STATE_BINDING; | |
| 147 | 147 | ||
| 148 | - if (typeof arguments[arguments.length - 1] === 'function') | ||
| 148 | + if (arguments.length && typeof arguments[arguments.length - 1] === 'function') | ||
| 149 | 149 | self.once('listening', arguments[arguments.length - 1]); | |
| 150 | 150 | ||
| 151 | 151 | if (port instanceof UDP) { | |
@@ -162,7 +162,7 @@ Socket.prototype.bind = function(port_ /*, address, callback*/) { | |||
| 162 | 162 | exclusive = !!port.exclusive; | |
| 163 | 163 | port = port.port; | |
| 164 | 164 | } else { | |
| 165 | - address = typeof arguments[1] === 'function' ? '' : arguments[1]; | ||
| 165 | + address = typeof address_ === 'function' ? '' : address_; | ||
| 166 | 166 | exclusive = false; | |
| 167 | 167 | } | |
| 168 | 168 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments