Skip to content

Commit ee80a21

Browse files
MaleDongtargos
authored andcommitted
dgram: change 'this' to 'self' for 'isConnected'
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>
1 parent 8486917 commit ee80a21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dgram.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ function clearQueue() {
519519

520520
function isConnected(self) {
521521
try {
522-
this.remoteAddress();
522+
self.remoteAddress();
523523
return true;
524524
} catch {
525525
return false;

0 commit comments

Comments
 (0)