[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pluggable-transports/snowflake-webext] 13/15: refactor: fewer `this` usages



This is an automated email from the git hooks/post-receive script.

cohosh pushed a commit to branch main
in repository pluggable-transports/snowflake-webext.

commit 27300671c2866dbeb5c32a249d9aa8cca528f55a
Author: WofWca <wofwca@xxxxxxxxxxxxxx>
AuthorDate: Sun Nov 6 15:38:59 2022 +0400

    refactor: fewer `this` usages
---
 proxypair.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/proxypair.js b/proxypair.js
index bd128c8..15d6ea7 100644
--- a/proxypair.js
+++ b/proxypair.js
@@ -179,13 +179,13 @@ class ProxyPair {
       (this.relayURL === undefined) ?
         WS.makeWebsocket(this.relayAddr, params) :
         WS.makeWebsocketFromURL(this.relayURL, params);
-    this.relay.label = 'websocket-relay';
-    this.relay.onopen = () => {
+    relay.label = 'websocket-relay';
+    relay.onopen = () => {
       clearTimeout(this.connectToRelayTimeoutId);
       log(relay.label + ' connected!');
       snowflake.ui.setStatus('connected');
     };
-    this.relay.onclose = () => {
+    relay.onclose = () => {
       log(relay.label + ' closed.');
       snowflake.ui.setStatus('disconnected.');
       if (this.counted) {
@@ -195,8 +195,8 @@ class ProxyPair {
       this.flush();
       this.close();
     };
-    this.relay.onerror = this.onError;
-    this.relay.onmessage = this.onRelayToClientMessage;
+    relay.onerror = this.onError;
+    relay.onmessage = this.onRelayToClientMessage;
     // TODO: Better websocket timeout handling.
     this.connectToRelayTimeoutId = setTimeout((() => {
       log(relay.label + ' timed out connecting.');

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits