Skip to content

Commit 1a54d0f

Browse files
MaleDongTrott
MaleDong
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 <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent eac8f50 commit 1a54d0f

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)