Bug 1106796 - fix JS strict warnings (undefined lastMessage.sourceFolder and 'let blocks deprecated' in activity manager. r=mkmelin, a=mkmelin
authoraceman <acelists@atlas.sk>
Sat, 13 Dec 2014 18:15:00 +0200
changeset 21521 5f3b32931edaeafc99d168f036ee13bc73033a1a
parent 21520 b3f8c6613ab0714527b03f383ebcef53aefd16d0
child 21522 8d3f8239c7b7b7a0d3950200409ceeff7ac84c7c
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
bugs1106796
Bug 1106796 - fix JS strict warnings (undefined lastMessage.sourceFolder and 'let blocks deprecated' in activity manager. r=mkmelin, a=mkmelin
mail/components/activity/content/activity.js
mail/components/activity/content/activity.xml
mail/components/activity/modules/moveCopy.js
--- a/mail/components/activity/content/activity.js
+++ b/mail/components/activity/content/activity.js
@@ -268,20 +268,20 @@ var activityObject =
           actbinding.detachFromActivity();
           actbinding.remove();
           actbinding = document.getAnonymousElementByAttribute(item,
                                                                'actID', '*');
         }
       }
     }
 
-    let (empty = this._activitiesView.cloneNode(false)) {
-      this._activitiesView.parentNode.replaceChild(empty, this._activitiesView);
-      this._activitiesView = empty;
-    }
+    let empty = this._activitiesView.cloneNode(false);
+    this._activitiesView.parentNode.replaceChild(empty, this._activitiesView);
+    this._activitiesView = empty;
+
     this._groupCache = {};
     this.rebuild();
     this._ignoreNotifications = false;
     this._activitiesView.focus();
   },
 
   processKeyEvent: function(event) {
     switch (event.keyCode) {
--- a/mail/components/activity/content/activity.xml
+++ b/mail/components/activity/content/activity.xml
@@ -130,21 +130,21 @@
             failed: "failed",
             waitingforinput: "waitingForInput",
             waitingforretry: "waitingForRetry",
             yesterday: "yesterday",
             monthDate: "monthDate"
           };
 
           // convert strings to those in the string bundle
-          let (sb = document.getElementById("activityStrings")) {
-            let getStr = function(string) sb.getString(string);
-            for (let [name, value] in Iterator(this.text))
-                this.text[name] = typeof value == "string" ? getStr(value)
-                                                           : value.map(getStr);
+          let sb = document.getElementById("activityStrings");
+          let getStr = function(string) sb.getString(string);
+          for (let [name, value] in Iterator(this.text)) {
+            this.text[name] = typeof value == "string" ? getStr(value)
+                                                       : value.map(getStr);
           }
         } catch (e) {
           this.log.error("Exception: " + e);
         }
         ]]>
       </constructor>
       <destructor>
        <![CDATA[
--- a/mail/components/activity/modules/moveCopy.js
+++ b/mail/components/activity/modules/moveCopy.js
@@ -117,20 +117,20 @@ let moveCopyModule =
         return;
 
       // get the folder of the moved/copied messages
       let folder = aSrcMsgList.queryElementAt(0, Components.interfaces.nsIMsgDBHdr).folder;
       this.log.info("got folder");
 
       let displayCount = count;
 
-      let activities = this.activityMgr.getActivities({})
+      let activities = this.activityMgr.getActivities({});
       if (activities.length > 0 &&
           activities[activities.length-1].id == this.lastMessage.id &&
-          this.lastMessage.type == aMove ? "moveMail" : "copyMail" &&
+          this.lastMessage.type == (aMove ? "moveMail" : "copyMail") &&
           this.lastMessage.sourceFolder == folder.prettiestName &&
           this.lastMessage.destFolder == aDestFolder.prettiestName)
       {
         displayCount += this.lastMessage.count;
         this.activityMgr.removeActivity(this.lastMessage.id);
       }
 
       let statusText = '';