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: Fixed typo with shadowRoot getter Created March 14, 2017, 10:28 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
Index: lib/utils.js
diff --git a/lib/utils.js b/lib/utils.js
index 9361039f8137f85bb5fe4f7fbf43590531c9a657..06ac426a670158814d1864a581b55363ca7632d2 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -37,9 +37,7 @@ let Utils = exports.Utils = {
document.addEventListener("DOMContentLoaded", onDOMContentLoaded);
}
else
- {
setTimeout(callback, 0);
- }
},
get appLocale()
{
@@ -58,8 +56,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 +74,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 +107,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);
Wladimir Palant 2017/03/14 13:03:29 I'd rather put the entire .replace on the next lin
kzar 2017/03/15 04:57:52 Done.
},
yield()

Powered by Google App Engine
This is Rietveld