Bug 1070525 - applying the 'delete' operator to an unqualified name is deprecated in Feed reader- r=mkmelin, a=mkmelin
authoralta88
Sun, 14 Dec 2014 09:50:10 -0500
changeset 21534 e6bcd82327d7b1a4fb74e141fcc4af6f2ba5ea32
parent 21533 941971dc9aecb91554a06b27776e535c581f8908
child 21535 507d7f2ac35d81f40357fedee75f4e197388a171
push id1305
push usermbanner@mozilla.com
push dateMon, 23 Feb 2015 19:48:12 +0000
treeherdercomm-beta@3ae4f13858fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, mkmelin
bugs1070525
Bug 1070525 - applying the 'delete' operator to an unqualified name is deprecated in Feed reader- r=mkmelin, a=mkmelin
mail/base/content/threadPane.js
mailnews/extensions/newsblog/content/Feed.js
mailnews/extensions/newsblog/content/FeedUtils.jsm
--- a/mail/base/content/threadPane.js
+++ b/mail/base/content/threadPane.js
@@ -80,17 +80,17 @@ function HandleColumnClick(columnID)
 
   var sortType;
   if (columnID in columnMap) {
     sortType = columnMap[columnID];
   } else {
     // If the column isn't in the map, check and see if it's a custom column
     try {
       // try to grab the columnHandler (an error is thrown if it does not exist)
-      columnHandler = gDBView.getColumnHandler(columnID);
+      gDBView.getColumnHandler(columnID);
 
       // it exists - set it to be the current custom column
       gDBView.curCustomColumn = columnID;
 
       sortType = "byCustom";
     } catch(err) {
         dump("unsupported sort column: " + columnID + " - no custom handler installed. (Error was: " + err + ")\n");
         return; // bail out
--- a/mailnews/extensions/newsblog/content/Feed.js
+++ b/mailnews/extensions/newsblog/content/Feed.js
@@ -55,16 +55,17 @@ Feed.prototype =
 {
   description: null,
   author: null,
   request: null,
   server: null,
   downloadCallback: null,
   resource: null,
   items: new Array(),
+  itemsStored: 0,
   mFolder: null,
   mInvalidFeed: false,
   mFeedType: null,
   mLastModified: null,
 
   get folder()
   {
     return this.mFolder;
@@ -84,17 +85,17 @@ Feed.prototype =
 
   get folderName()
   {
     if (this.mFolderName)
       return this.mFolderName;
 
     // Get a unique sanitized name. Use title or description as a base;
     // these are mandatory by spec. Length of 80 is plenty.
-    let folderName = (this.title || this.description).substr(0,80);
+    let folderName = (this.title || this.description || "").substr(0,80);
     let defaultName = FeedUtils.strings.GetStringFromName("ImportFeedsNew");
     return this.mFolderName = FeedUtils.getSanitizedFolderName(this.server.rootMsgFolder,
                                                                folderName,
                                                                defaultName,
                                                                true);
   },
 
   download: function(aParseItems, aCallback)
@@ -404,17 +405,17 @@ Feed.prototype =
       ds.Assert(this.resource, FeedUtils.RSS_LINK, aNewLink, true);
   },
 
   parse: function()
   {
     // Create a feed parser which will parse the feed.
     let parser = new FeedParser();
     this.itemsToStore = parser.parseFeed(this, this.request.responseXML);
-    delete parser;
+    parser = null;
 
     if (this.mInvalidFeed)
     {
       this.request = null;
       this.mInvalidFeed = false;
       return;
     }
 
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -274,18 +274,18 @@ var FeedUtils = {
               getFeed.next();
             }
             catch (ex) {
               if (ex instanceof StopIteration)
               {
                 // Finished with all feeds in base folder and its subfolders.
                 FeedUtils.log.debug("downloadFeed: Finished with folder - " +
                                     aFolder.name);
-                delete folder;
-                delete allFolders;
+                folder = null;
+                allFolders = null;
               }
               else
               {
                 FeedUtils.log.error("downloadFeed: error - " + ex);
                 FeedUtils.progressNotifier.downloaded({name: folder.name}, 0);
               }
             }
           }, Ci.nsIThread.DISPATCH_NORMAL);
@@ -300,18 +300,18 @@ var FeedUtils = {
       getFeed.next();
     }
     catch (ex) {
       if (ex instanceof StopIteration)
       {
         // Nothing to do.
         FeedUtils.log.debug("downloadFeed: Nothing to do in folder - " +
                             aFolder.name);
-        delete folder;
-        delete allFolders;
+        folder = null;
+        allFolders = null;
       }
       else
       {
         FeedUtils.log.error("downloadFeed: error - " + ex);
         FeedUtils.progressNotifier.downloaded({name: aFolder.name}, 0);
       }
     }
   },
@@ -457,17 +457,17 @@ var FeedUtils = {
     let itemds = this.getItemsDS(aServer);
     feed.invalidateItems();
     feed.removeInvalidItems(true);
     itemds.Flush();
 
     // Update folderpane.
     this.setFolderPaneProperty(aParentFolder, "_favicon", null);
 
-    delete feed;
+    feed = null;
   },
 
 /**
  * Change an existing feed's url, as identified by FZ_FEED resource in the
  * feeds.rdf subscriptions database.
  *
  * @param  obj aFeed      - the feed object
  * @param  string aNewUrl - new url
@@ -1454,17 +1454,17 @@ var FeedUtils = {
         // Should we do this on a timer so the text sticks around for a little
         // while?  It doesnt look like we do it on a timer for newsgroups so
         // we'll follow that model.  Don't clear the status text if we just
         // dumped an error to the status bar!
         if (aErrorCode == FeedUtils.kNewsBlogSuccess && this.mStatusFeedback)
           this.mStatusFeedback.showStatusString("");
       }
 
-      delete feed;
+      feed = null;
     },
 
     // This gets called after the RSS parser finishes storing a feed item to
     // disk. aCurrentFeedItems is an integer corresponding to how many feed
     // items have been downloaded so far.  aMaxFeedItems is an integer
     // corresponding to the total number of feed items to download
     onFeedItemStored: function (feed, aCurrentFeedItems, aMaxFeedItems)
     {