Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/utils.js

Issue 29545700: Issue 5685 - Pass ESLint (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Address review comments Created Sept. 18, 2017, 12:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/updater.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/utils.js
===================================================================
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -10,54 +10,55 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-var Utils = exports.Utils = {
+"use strict";
+
+let Utils = {
systemPrincipal: null,
- getString: function(id)
+ getString(id)
{
return id;
},
- runAsync: function(callback, thisPtr)
+ runAsync(callback, thisPtr, ...params)
{
- var params = Array.prototype.slice.call(arguments, 2);
- window.setTimeout(function()
+ setTimeout(() =>
{
callback.apply(thisPtr, params);
}, 0);
},
get appLocale()
{
return _appInfo.locale;
},
- generateChecksum: function(lines)
+ generateChecksum(lines)
{
// We cannot calculate MD5 checksums yet :-(
return null;
},
- checkLocalePrefixMatch: function(prefixes)
+ checkLocalePrefixMatch(prefixes)
{
if (!prefixes)
return null;
let list = prefixes.split(",");
for (let prefix of list)
if (new RegExp("^" + prefix + "\\b").test(this.appLocale))
return prefix;
return null;
},
- chooseFilterSubscription: function(subscriptions)
+ chooseFilterSubscription(subscriptions)
{
let selectedItem = null;
let selectedPrefix = null;
let matchCount = 0;
for (let i = 0; i < subscriptions.length; i++)
{
let subscription = subscriptions[i];
if (!selectedItem)
@@ -86,8 +87,10 @@
selectedPrefix = prefix;
}
}
}
}
return selectedItem;
}
};
+
+exports.Utils = Utils;
« no previous file with comments | « lib/updater.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld