GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 6788592d authored by Arlo Breault's avatar Arlo Breault

Require semis

Trac: 34140
parent 0c2ab258
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"indent": ["error", 2, { "indent": ["error", 2, {
"SwitchCase": 1, "SwitchCase": 1,
"MemberExpression": 0 "MemberExpression": 0
}] }],
"semi": "error"
} }
} }
...@@ -18,7 +18,7 @@ class Broker { ...@@ -18,7 +18,7 @@ class Broker {
this.getClientOffer = this.getClientOffer.bind(this); this.getClientOffer = this.getClientOffer.bind(this);
this._postRequest = this._postRequest.bind(this); this._postRequest = this._postRequest.bind(this);
this.config = config this.config = config;
this.url = config.brokerUrl; this.url = config.brokerUrl;
this.clients = 0; this.clients = 0;
if (0 === this.url.indexOf('localhost', 0)) { if (0 === this.url.indexOf('localhost', 0)) {
...@@ -64,7 +64,7 @@ class Broker { ...@@ -64,7 +64,7 @@ class Broker {
} }
}; };
this._xhr = xhr; // Used by spec to fake async Broker interaction this._xhr = xhr; // Used by spec to fake async Broker interaction
var data = {"Version": "1.1", "Sid": id, "Type": this.config.proxyType} var data = {"Version": "1.1", "Sid": id, "Type": this.config.proxyType};
return this._postRequest(xhr, 'proxy', JSON.stringify(data)); return this._postRequest(xhr, 'proxy', JSON.stringify(data));
}); });
} }
......
...@@ -213,6 +213,6 @@ var debug, snowflake, config, broker, ui, log, dbg, init, update, silenceNotific ...@@ -213,6 +213,6 @@ var debug, snowflake, config, broker, ui, log, dbg, init, update, silenceNotific
}); });
init(); init();
}); });
} };
}()); }());
...@@ -49,7 +49,7 @@ var concatJS = function(outDir, init, outFile, pre) { ...@@ -49,7 +49,7 @@ var concatJS = function(outDir, init, outFile, pre) {
}; };
var copyTranslations = function(outDir) { var copyTranslations = function(outDir) {
execSync('git submodule update --init -- translation') execSync('git submodule update --init -- translation');
execSync(`cp -rf translation/* ${outDir}/_locales/`); execSync(`cp -rf translation/* ${outDir}/_locales/`);
}; };
...@@ -65,7 +65,7 @@ var getDisplayName = function(locale) { ...@@ -65,7 +65,7 @@ var getDisplayName = function(locale) {
return ''; return '';
} }
return name; return name;
} };
var availableLangs = function() { var availableLangs = function() {
let out = "const availableLangs = new Set([\n"; let out = "const availableLangs = new Set([\n";
...@@ -155,7 +155,7 @@ task('node', 'build the node binary', function() { ...@@ -155,7 +155,7 @@ task('node', 'build the node binary', function() {
}); });
var updateVersion = function(file, version) { var updateVersion = function(file, version) {
var obj = require(file) var obj = require(file);
obj.version = version; obj.version = version;
writeFileSync(file, JSON.stringify(obj, null, 2), 'utf8'); writeFileSync(file, JSON.stringify(obj, null, 2), 'utf8');
}; };
...@@ -211,5 +211,5 @@ if (tasks.has(cmd)) { ...@@ -211,5 +211,5 @@ if (tasks.has(cmd)) {
tasks.forEach(function(value, key) { tasks.forEach(function(value, key) {
console.log(key + ' - ' + value.msg); console.log(key + ' - ' + value.msg);
}) });
} }
...@@ -45,7 +45,7 @@ class Snowflake { ...@@ -45,7 +45,7 @@ class Snowflake {
beginWebRTC() { beginWebRTC() {
this.pollBroker(); this.pollBroker();
return this.pollTimeout = setTimeout((() => { return this.pollTimeout = setTimeout((() => {
return this.beginWebRTC() return this.beginWebRTC();
}), this.pollInterval); }), this.pollInterval);
} }
......
...@@ -37,7 +37,7 @@ var getLang = function() { ...@@ -37,7 +37,7 @@ var getLang = function() {
return lang; return lang;
} }
return defaultLang; return defaultLang;
} };
var fill = function(n, func) { var fill = function(n, func) {
switch(n.nodeType) { switch(n.nodeType) {
...@@ -47,14 +47,14 @@ var fill = function(n, func) { ...@@ -47,14 +47,14 @@ var fill = function(n, func) {
if (m) { if (m) {
var val = func(m[1]); var val = func(m[1]);
if (val != undefined) { if (val != undefined) {
n.innerHTML = val n.innerHTML = val;
} }
} }
n.childNodes.forEach(c => fill(c, func)); n.childNodes.forEach(c => fill(c, func));
break; break;
} }
} }
} };
fetch(`./_locales/${getLang()}/messages.json`) fetch(`./_locales/${getLang()}/messages.json`)
...@@ -64,7 +64,7 @@ fetch(`./_locales/${getLang()}/messages.json`) ...@@ -64,7 +64,7 @@ fetch(`./_locales/${getLang()}/messages.json`)
}) })
.then((json) => { .then((json) => {
var language = document.getElementById('language-switcher'); var language = document.getElementById('language-switcher');
var lang = `${getLang()}` var lang = `${getLang()}`;
language.innerText = availableLangs[lang].name + ' (' + lang + ')'; language.innerText = availableLangs[lang].name + ' (' + lang + ')';
var messages = new Messages(json); var messages = new Messages(json);
fill(document.body, (m) => { fill(document.body, (m) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment