summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaleDong <maledong_github@outlook.com>2019-04-22 09:41:33 +0800
committerRich Trott <rtrott@gmail.com>2019-04-23 21:42:46 -0700
commit1a54d0fa59e0e1c90db1b66907c48a286d5b26a3 (patch)
tree46c33c6f123d9dc7cbc49b0dadf688bb22d94a5a
parenteac8f50ca664186d099c03dcac71a22fde89671f (diff)
downloadandroid-node-v8-1a54d0fa59e0e1c90db1b66907c48a286d5b26a3.tar.gz
android-node-v8-1a54d0fa59e0e1c90db1b66907c48a286d5b26a3.tar.bz2
android-node-v8-1a54d0fa59e0e1c90db1b66907c48a286d5b26a3.zip
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: https://github.com/nodejs/node/pull/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>
-rw-r--r--lib/dgram.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dgram.js b/lib/dgram.js
index 5a6d5aca2c..b38aa39c21 100644
--- a/lib/dgram.js
+++ b/lib/dgram.js
@@ -519,7 +519,7 @@ function clearQueue() {
function isConnected(self) {
try {
- this.remoteAddress();
+ self.remoteAddress();
return true;
} catch {
return false;