Skip to content

Commit

Permalink
dgram: change 'this' to 'self' for 'isConnected'
Browse files Browse the repository at this point in the history
The function 'isConnected' is directly called by many 'Socket' instance,
so we shouldn't directly use 'this' because 'this' will be the self of
function itself, and we should use 'self' as the instance of 'Socket'
function.

PR-URL: #27338
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
MaleDong authored and targos committed Apr 27, 2019
1 parent 8486917 commit ee80a21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function clearQueue() {

function isConnected(self) {
try {
this.remoteAddress();
self.remoteAddress();
return true;
} catch {
return false;
Expand Down

0 comments on commit ee80a21

Please sign in to comment.