[tor-commits] [torbutton/master] Bug 18466: Prevent ReferenceErrors in tor-control-port.js

gk at torproject.org gk at torproject.org
Fri Apr 8 12:49:20 UTC 2016


commit e6939a0043b8fc944ecfa4559efbd503d1d758c1
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Wed Mar 2 17:27:25 2016 -0800

    Bug 18466: Prevent ReferenceErrors in tor-control-port.js
---
 src/modules/tor-control-port.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/modules/tor-control-port.js b/src/modules/tor-control-port.js
index e1ee6bc..1cef898 100644
--- a/src/modules/tor-control-port.js
+++ b/src/modules/tor-control-port.js
@@ -39,7 +39,7 @@ log("Loading tor-control-port.js\n");
 
 // ## io
 // I/O utilities namespace
-let io = io || {};
+let io = {};
 
 // __io.asyncSocketStreams(host, port)__.
 // Creates a pair of asynchronous input and output streams for a socket at the
@@ -286,7 +286,7 @@ io.controlSocket = function (host, port, password, onError) {
 
 // ## utils
 // A namespace for utility functions
-let utils = utils || {};
+let utils = {};
 
 // __utils.identity(x)__.
 // Returns its argument unchanged.
@@ -390,7 +390,7 @@ utils.rejectPromise = errorMessage => Promise.reject(new Error(errorMessage));
 
 // ## info
 // A namespace for functions related to tor's GETINFO and GETCONF command.
-let info = info || {};
+let info = {};
 
 // __info.keyValueStringsFromMessage(messageText)__.
 // Takes a message (text) response to GETINFO or GETCONF and provides
@@ -567,7 +567,7 @@ info.getConf = function (aControlSocket, key) {
 // ## event
 // Handlers for events
 
-let event = event || {};
+let event = {};
 
 // __event.parsers__.
 // A map of EVENT keys to parsing functions, which convert result strings to JavaScript
@@ -603,7 +603,7 @@ event.watchEvent = function (controlSocket, type, filter, onData) {
 
 // ## tor
 // Things related to the main controller.
-let tor = tor || {};
+let tor = {};
 
 // __tor.controllerCache__.
 // A map from "host:port" to controller objects. Prevents redundant instantiation





More information about the tor-commits mailing list