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

Unified Diff: lib/utils.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Addressed more feedback Created March 31, 2017, 8:23 a.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/url.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/utils.js
diff --git a/lib/utils.js b/lib/utils.js
index 18f956330f08fc8a0b1477ef43260fe3080a227a..8b73acf39a9f31b1eeb64c23912e78ac79528bd6 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -58,8 +58,10 @@ let Utils = exports.Utils = {
return null;
for (let prefix of prefixes.split(","))
+ {
if (new RegExp("^" + prefix + "\\b").test(this.appLocale))
return prefix;
+ }
return null;
},
@@ -74,7 +76,9 @@ let Utils = exports.Utils = {
if (!selectedItem)
selectedItem = subscription;
- let prefix = Utils.checkLocalePrefixMatch(subscription.getAttribute("prefixes"));
+ let prefix = Utils.checkLocalePrefixMatch(
+ subscription.getAttribute("prefixes")
+ );
if (prefix)
{
if (!selectedPrefix || selectedPrefix.length < prefix.length)
@@ -105,7 +109,8 @@ let Utils = exports.Utils = {
getDocLink(linkID)
{
let docLink = require("prefs").Prefs.documentation_link;
- return docLink.replace(/%LINK%/g, linkID).replace(/%LANG%/g, Utils.appLocale);
+ return docLink.replace(/%LINK%/g, linkID)
+ .replace(/%LANG%/g, Utils.appLocale);
},
yield()
« no previous file with comments | « lib/url.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld