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

Unified Diff: lib/typoRules.js

Issue 6695604965081088: Issue 2549 - Fix documentation generation for URL Fixer (Closed)
Patch Set: Created May 18, 2015, 7:46 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/typoFixer.js ('k') | metadata.gecko » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/typoRules.js
===================================================================
--- a/lib/typoRules.js
+++ b/lib/typoRules.js
@@ -27,17 +27,17 @@ let CUSTOM_RULE_PRIORITY = 0x7FFFFFFF;
let rules = {expressions: []};
loadRules();
// Make first attempt to update rules after five minutes
let updateTimer = null;
updateTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
updateTimer.initWithCallback(onTimer, 1000 * 60 * 5, Ci.nsITimer.TYPE_REPEATING_SLACK);
-onShutdown.add(function() updateTimer.cancel());
+onShutdown.add(() => updateTimer.cancel());
function loadRules()
{
loadRulesFrom(Services.io.newFileURI(getRuleFile()).spec, false, function(success)
{
if (!success)
loadRulesFrom(require("info").addonRoot + "defaults/typoRules.json", true);
});
@@ -91,17 +91,17 @@ function loadRulesFrom(url, ignoreVersio
callback(false);
}
}
function getRuleFile()
{
let result = FileUtils.getFile("ProfD", [require("info").addonName + "-rules.json"]);
- getRuleFile = function() result;
+ getRuleFile = () => result;
return getRuleFile();
}
function addCustomRules()
{
for (let domain in Prefs.whitelist)
onWhitelistEntryAdded(domain);
}
« no previous file with comments | « lib/typoFixer.js ('k') | metadata.gecko » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld