Bug 687332: Fix up LocaleRepository.jsm. r=mbrubeck
authorKyle Huey <khuey@kylehuey.com>
Thu, 29 Sep 2011 12:06:36 -0400
changeset 77820 ff191893660f140379dcdf4ea035b38c11887360
parent 77819 6d59d323116d6f2541c341d7224f933af0cecc14
child 77821 69e1b5167409a00a1b201963c5e7415e37b869fb
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmbrubeck
bugs687332
milestone10.0a1
Bug 687332: Fix up LocaleRepository.jsm. r=mbrubeck
mobile/modules/LocaleRepository.jsm
--- a/mobile/modules/LocaleRepository.jsm
+++ b/mobile/modules/LocaleRepository.jsm
@@ -100,34 +100,34 @@ var LocaleRepository = {
     url = Services.urlFormatter.formatURL(url);
 
     let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
     request.mozBackgroundRequest = true;
     request.open("GET", url, true);
     request.overrideMimeType("text/xml");
   
     let self = this;
-    request.onreadystatechange = function () {
+    request.addEventListener("readystatechange", function () {
       if (request.readyState == 4) {
         if (request.status == 200) {
           self.log("---- got response")
           let documentElement = request.responseXML.documentElement;
           let elements = documentElement.getElementsByTagName("addon");
           let totalResults = elements.length;
           let parsedTotalResults = parseInt(documentElement.getAttribute("total_results"));
           if (parsedTotalResults >= totalResults)
             totalResults = parsedTotalResults;
 
           // TODO: Create a real Skip object from installed locales
           self._parseLocales(elements, totalResults, { ids: [], sourceURIs: [] }, aCallback);
         } else {
           Cu.reportError("Locale Repository: Error getting locale from AMO [" + request.status + "]");
         }
       }
-    };
+    }, false);
   
     request.send(null);
   },
 
   _parseLocale: function _parseLocale(aElement, aSkip) {
     let skipIDs = (aSkip && aSkip.ids) ? aSkip.ids : [];
     let skipSourceURIs = (aSkip && aSkip.sourceURIs) ? aSkip.sourceURIs : [];