Skip to content

Commit 82f549e

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
dgram: scope redeclared variables
A few variables in `lib/dgram.js` are redeclared with `var` in a scope where they have already been declared. These instances can be scoped more narrowly with `const`, so that's what this change does. PR-URL: #4940 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 43d4db4 commit 82f549e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/dgram.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ function lookup6(address, callback) {
4040

4141
function newHandle(type) {
4242
if (type == 'udp4') {
43-
var handle = new UDP();
43+
const handle = new UDP();
4444
handle.lookup = lookup4;
4545
return handle;
4646
}
4747

4848
if (type == 'udp6') {
49-
var handle = new UDP();
49+
const handle = new UDP();
5050
handle.lookup = lookup6;
5151
handle.bind = handle.bind6;
5252
handle.send = handle.send6;
@@ -209,7 +209,7 @@ Socket.prototype.bind = function(port_ /*, address, callback*/) {
209209
if (!self._handle)
210210
return; // handle has been closed in the mean time
211211

212-
var err = self._handle.bind(ip, port || 0, flags);
212+
const err = self._handle.bind(ip, port || 0, flags);
213213
if (err) {
214214
var ex = exceptionWithHostPort(err, 'bind', ip, port);
215215
self.emit('error', ex);

0 commit comments

Comments
 (0)