Skip to content

Commit 1800bf4

Browse files
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 d319561 commit 1800bf4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎lib/dgram.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ function lookup6(address, callback){
4040

4141
functionnewHandle(type){
4242
if(type=='udp4'){
43-
varhandle=newUDP();
43+
consthandle=newUDP();
4444
handle.lookup=lookup4;
4545
returnhandle;
4646
}
4747

4848
if(type=='udp6'){
49-
varhandle=newUDP();
49+
consthandle=newUDP();
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-
varerr=self._handle.bind(ip,port||0,flags);
212+
consterr=self._handle.bind(ip,port||0,flags);
213213
if(err){
214214
varex=exceptionWithHostPort(err,'bind',ip,port);
215215
self.emit('error',ex);
@@ -371,7 +371,7 @@ function doSend(ex, self, ip, buffer, address, port, callback){
371371
!!callback);
372372
if(err&&callback){
373373
// don't emit as error, dgram_legacy.js compatibility
374-
varex=exceptionWithHostPort(err,'send',address,port);
374+
constex=exceptionWithHostPort(err,'send',address,port);
375375
process.nextTick(callback,ex);
376376
}
377377
}

0 commit comments

Comments
(0)