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

Unified Diff: lib/synchronizer.js

Issue 9251039: Get rid of nested functions declarations that are not on top level (causes strict mode warnings) (Closed)
Patch Set: Created Jan. 23, 2013, 12:52 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/requestNotifier.js ('k') | lib/typoAppIntegration.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/synchronizer.js
===================================================================
--- a/lib/synchronizer.js
+++ b/lib/synchronizer.js
@@ -56,30 +56,30 @@ let executing = {__proto__: null};
let Synchronizer = exports.Synchronizer =
{
/**
* Called on module startup.
*/
init: function()
{
TimeLine.enter("Entered Synchronizer.init()");
-
+
let callback = function()
{
timer.delay = CHECK_INTERVAL * MILLISECONDS_IN_SECOND;
checkSubscriptions();
};
-
+
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(callback, INITIAL_DELAY * MILLISECONDS_IN_SECOND, Ci.nsITimer.TYPE_REPEATING_SLACK);
onShutdown.add(function()
{
timer.cancel();
});
-
+
TimeLine.leave("Synchronizer.init() done");
},
/**
* Checks whether a subscription is currently being downloaded.
* @param {String} url URL of the subscription
* @return {Boolean}
*/
@@ -163,30 +163,30 @@ let Synchronizer = exports.Synchronizer
// Ignore modification date if we are downloading from a different location
forceDownload = true;
}
let {addonVersion} = require("info");
loadFrom = loadFrom.replace(/%VERSION%/, "ABP" + addonVersion);
let request = null;
- function errorCallback(error)
+ let errorCallback = function(error)
{
let channelStatus = -1;
try
{
channelStatus = request.channel.status;
} catch (e) {}
let responseStatus = "";
try
{
responseStatus = request.channel.QueryInterface(Ci.nsIHttpChannel).responseStatus;
} catch (e) {}
setError(subscription, error, channelStatus, responseStatus, loadFrom, isBaseLocation, manual);
- }
+ };
try
{
request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
request.mozBackgroundRequest = true;
request.open("GET", loadFrom);
}
catch (e)
@@ -215,17 +215,17 @@ let Synchronizer = exports.Synchronizer
{
if (iid.equals(Ci.nsIChannelEventSink))
{
try {
oldEventSink = oldNotifications.QueryInterface(iid);
} catch(e) {}
return this;
}
-
+
if (oldNotifications)
return oldNotifications.QueryInterface(iid);
else
throw Cr.NS_ERROR_NO_INTERFACE;
},
asyncOnChannelRedirect: function(oldChannel, newChannel, flags, callback)
{
« no previous file with comments | « lib/requestNotifier.js ('k') | lib/typoAppIntegration.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld