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

Unified Diff: lib/rules.js

Issue 8450003: Reimplemented whitelist handling (Closed)
Patch Set: Modifications only, different base revision Created Sept. 27, 2012, 2:54 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 | « chrome/content/tests/tests/suffixTreeManipulation.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/rules.js
===================================================================
--- a/lib/rules.js
+++ b/lib/rules.js
@@ -90,24 +90,24 @@ function getRuleFile()
function addCustomRules()
{
for (let domain in Prefs.whitelist)
onWhitelistEntryAdded(domain);
}
function onWhitelistEntryAdded(domain)
{
- let reverse = Array.prototype.slice.call(domain).reverse().join("");
+ let reverse = domain.split("").reverse().join("");
addSuffix(rules.domain, reverse, CUSTOM_RULE_PRIORITY);
}
exports.onWhitelistEntryAdded = onWhitelistEntryAdded;
function onWhitelistEntryRemoved(domain)
{
- let reverse = Array.prototype.slice.call(domain).reverse().join("");
+ let reverse = domain.split("").reverse().join("");
removeSuffix(rules.domain, reverse, CUSTOM_RULE_PRIORITY);
}
exports.onWhitelistEntryRemoved = onWhitelistEntryRemoved;
function addSuffix(tree, suffix, priority)
{
if (suffix.length == 0)
{
« no previous file with comments | « chrome/content/tests/tests/suffixTreeManipulation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld