Bug 684582 - Fix strict warnings: assignment to undeclared variable. r=philipp, a=philipp SEAMONKEY_2_4b2_BUILD1 SEAMONKEY_2_4b2_RELEASE
authorStefan Sitter <ssitter@gmail.com>
Fri, 09 Sep 2011 00:36:50 +0200
changeset 8437 fe74f461b4b8357818fa289765b2ae053b3237fb
parent 8436 b55ae861a76621735bfb854169538e432c470165
child 8438 4f5ee0e1124f8025d2ad0f5c61fd2b6468cc1aa6
child 8440 44d9dc13923479ea5c0550372f3f7d669ea0f0c9
child 8442 c32f3ca7db265b102cee0831cd6fc4f2f02a668c
push idunknown
push userunknown
push dateunknown
reviewersphilipp, philipp
bugs684582
Bug 684582 - Fix strict warnings: assignment to undeclared variable. r=philipp, a=philipp
calendar/base/content/calendar-month-view.xml
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-task-tree.xml
calendar/base/content/dialogs/calendar-print-dialog.js
calendar/base/content/widgets/calendar-widgets.xml
calendar/base/src/calRecurrenceInfo.js
calendar/import-export/calMonthGridPrinter.js
calendar/providers/storage/calStorageCalendar.js
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -578,28 +578,28 @@
       <method name="setSelectedItems">
         <parameter name="aCount"/>
         <parameter name="aItems"/>
         <parameter name="aSuppressEvent"/>
         <body><![CDATA[
           if (this.mSelectedItems.length) {
               for each (var item in this.mSelectedItems) {
                   let oldboxes = this.findDayBoxesForItem(item);
-                  for each (oldbox in oldboxes) {
+                  for each (let oldbox in oldboxes) {
                       oldbox.unselectItem(item);
                   }
               }
           }
 
           this.mSelectedItems = aItems || [];
 
           if (this.mSelectedItems.length) {
               for each (var item in this.mSelectedItems) {
                   let newboxes = this.findDayBoxesForItem(item);
-                  for each (newbox in newboxes) {
+                  for each (let newbox in newboxes) {
                       newbox.selectItem(item);
                   }
               }
           }
 
           if (!aSuppressEvent) {
               this.fireEvent("itemselect", this.mSelectedItems);
           }
@@ -870,17 +870,17 @@
             headerkids[i].collapsed = dayOff && !this.mDisplayDaysOff;
           }
         ]]></body>
       </method>
 
       <method name="findDayBoxForDate">
         <parameter name="aDate"/>
         <body><![CDATA[
-          for each (box in this.mDateBoxes) {
+          for each (let box in this.mDateBoxes) {
             if (box.mDate.compare(aDate) == 0)
               return box;
           }
           return null;
         ]]></body>
       </method>
 
       <method name="findDayBoxesForItem">
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -2060,17 +2060,17 @@
          newItem = cal.setItemToAllDay(newItem, true);
          return newItem;
         ]]></body>
       </method>
 
       <method name="selectOccurrence">
         <parameter name="aItem"/>
         <body><![CDATA[
-          for each (itemBox in this.mItemBoxes) {
+          for each (let itemBox in this.mItemBoxes) {
             if (aItem && (itemBox.occurrence.hashId == aItem.hashId)) {
               itemBox.selected = true;
             }
 
           }
         ]]></body>
       </method>
       <method name="unselectOccurrence">
@@ -3199,17 +3199,17 @@
               }
           }
           removeExtraKids(daybox);
           removeExtraKids(headerdaybox);
           removeExtraKids(this.labeldaybox);
 
           // fix pixels-per-minute
           this.onResize();
-          for each (col in this.mDateColumns) {
+          for each (let col in this.mDateColumns) {
                col.column.endLayoutBatchChange();
           }
 
           // Adjust scrollbar spacers
           this.adjustScrollBarSpacers();
         ]]></body>
       </method>
 
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -569,17 +569,17 @@
                       this.sortDirection = "descending";
                   }
               }
               this.selectedColumn = aCol.element;
               let selectedItems = this.binding.selectedTasks;
               this.binding.sortItems();
               if (selectedItems != undefined) {
                   this.tree.view.selection.clearSelection();
-                  for each (item in selectedItems){
+                  for each (let item in selectedItems){
                       let index = this.binding.mHash2Index[item.hashId];
                       this.tree.view.selection.toggleSelect(index);
                   }
               }
           },
 
           // The text for a given cell. If a column consists only of an
           // image, then the empty string is returned.
--- a/calendar/base/content/dialogs/calendar-print-dialog.js
+++ b/calendar/base/content/dialogs/calendar-print-dialog.js
@@ -165,17 +165,17 @@ function getWhatToPrintSettings() {
         settings.end = settings.end.clone();
         settings.end.day += 1;
         break;
     case 'selected':
         if (settings.printEvents) {
             settings.eventList = theView.getSelectedItems({});
         }
         if (settings.printTasks) {
-            selectedTasks = window.opener.document.getElementById("unifinder-todo-tree").selectedTasks;
+            let selectedTasks = window.opener.document.getElementById("unifinder-todo-tree").selectedTasks;
             for each (var task in selectedTasks) {
                 settings.eventList.push(task);
             }
         }
         break;
     case 'custom':
         // We return the time from the timepickers using the selected
         // timezone, as not doing so in timezones with a positive offset
--- a/calendar/base/content/widgets/calendar-widgets.xml
+++ b/calendar/base/content/widgets/calendar-widgets.xml
@@ -403,17 +403,17 @@
         ]]></body>
       </method>
 
       <!-- removes all dropShadows from the binding. Dropshadows are recognized
            as such by carrying an attribute "dropshadow" -->
       <method name="removeDropShadows">
         <body><![CDATA[
             // method that may be overwritten by derived bindings...
-            for each (shadow in this.calendarView.mDropShadows) {
+            for each (let shadow in this.calendarView.mDropShadows) {
                 cal.removeChildElementsByAttribute(shadow, "class", "dropshadow");
             }
             this.calendarView.mDropShadows = null;
         ]]></body>
       </method>
 
       <!-- By setting the attribute "dropbox" to "true" or "false" the
            dropshadows are added or removed -->
--- a/calendar/base/src/calRecurrenceInfo.js
+++ b/calendar/base/src/calRecurrenceInfo.js
@@ -525,17 +525,17 @@ calRecurrenceInfo.prototype = {
         var maxCount;
         if (rangeStart && rangeEnd) {
             maxCount = 0;
         } else {
             maxCount = aMaxCount;
         }
 
         // Apply positive rules
-        for each (ritem in this.mPositiveRules) {
+        for each (let ritem in this.mPositiveRules) {
             var cur_dates = ritem.getOccurrences(startDate,
                                                  searchStart,
                                                  rangeEnd,
                                                  maxCount, {});
             if (cur_dates.length == 0) {
                 continue;
             }
 
@@ -566,17 +566,17 @@ calRecurrenceInfo.prototype = {
                 // TODO if cur_dates[] is also sorted, then this binary
                 // search could be optimized further
                 binaryInsert(dates, { id: date, rstart: date }, ridDateSortComptor);
                 occurrenceMap[dateKey] = true;
             }
         }
 
         // Apply negative rules
-        for each (ritem in this.mNegativeRules) {
+        for each (let ritem in this.mNegativeRules) {
             var cur_dates = ritem.getOccurrences(startDate,
                                                  searchStart,
                                                  rangeEnd,
                                                  maxCount, {});
             if (cur_dates.length == 0) {
                 continue;
             }
 
--- a/calendar/import-export/calMonthGridPrinter.js
+++ b/calendar/import-export/calMonthGridPrinter.js
@@ -115,17 +115,17 @@ calMonthPrinter.prototype = {
         // we take the aStart and aEnd literally, we'll print 3 months (because of
         // the extra days at the start/end), but we should avoid that.
         //
         // Basically, we check whether aStart falls in the same week as the start
         // of a month (ie aStart  is Jan 29, which often is in the same week as
         // Feb 1), and similarly whether aEnd falls in the same week as the end of
         // a month.
         let weekStart = cal.getPrefSafe("calendar.week.start", 0);
-        maybeNewStart = start.clone();
+        let maybeNewStart = start.clone();
         maybeNewStart.day = 1;
         maybeNewStart.month = start.month+1;
 
         let dt = start.clone();
 
         // First we have to adjust the end date for comparison, as the
         // provided end date is exclusive, i.e. will not be displayed.
 
@@ -314,17 +314,17 @@ calMonthPrinter.prototype = {
                 // end dates are exclusive
                 if (sDate.isDate) {
                     eDate = eDate.clone();
                     eDate.day -= 1;
                 }
                 if (!eDate || eDate.compare(dt) == -1) {
                     continue;
                 }
-                itemListIndex = i;
+                let itemListIndex = i;
                 if (!sDate || sDate.compare(dt) == 1) {
                     break;
                 }
 
                 let time = (!sDate.isDate ? cal.getDateFormatter().formatTime(sDate) : "");
                 let calColor = item.calendar.getProperty('color') || "#A8C2E1";
                 let pb2 = Components.classes["@mozilla.org/preferences-service;1"]
                                     .getService(Components.interfaces.nsIPrefBranch2);
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -2044,17 +2044,17 @@ calStorageCalendar.prototype = {
 
     writeRecurrence: function cSC_writeRecurrence(item, olditem) {
         var flags = 0;
 
         var rec = item.recurrenceInfo;
         if (rec) {
             flags = CAL_ITEM_FLAG.HAS_RECURRENCE;
             var ritems = rec.getRecurrenceItems ({});
-            for (i in ritems) {
+            for (let i in ritems) {
                 var ritem = ritems[i];
                 var ap = this.mInsertRecurrence.params;
                 try {
                     this.prepareStatement(this.mInsertRecurrence);
                     ap.item_id = item.id;
                     ap.recur_index = i;
                     ap.is_negative = ritem.isNegative;
                     if (calInstanceOf(ritem, Components.interfaces.calIRecurrenceDate)) {
@@ -2114,34 +2114,34 @@ calStorageCalendar.prototype = {
 
             var exceptions = rec.getExceptionIds ({});
             if (exceptions.length > 0) {
                 flags |= CAL_ITEM_FLAG.HAS_EXCEPTIONS;
 
                 // we need to serialize each exid as a separate
                 // event/todo; setupItemBase will handle
                 // writing the recurrenceId for us
-                for each (exid in exceptions) {
+                for each (let exid in exceptions) {
                     let ex = rec.getExceptionFor(exid);
                     if (!ex)
                         throw Components.results.NS_ERROR_UNEXPECTED;
                     this.writeItem(ex, null);
                 }
             }
         } else  if (item.recurrenceId && item.recurrenceId.isDate) {
             flags |= CAL_ITEM_FLAG.RECURRENCE_ID_ALLDAY;
         }
 
         return flags;
     },
 
     writeAttachments: function cSC_writeAttachments(item, olditem) {
         let attachments = item.getAttachments({});
         if (attachments && attachments.length > 0) {
-            for each (att in attachments) {
+            for each (let att in attachments) {
                 let ap = this.mInsertAttachment.params;
                 try {
                     this.prepareStatement(this.mInsertAttachment);
                     this.setDateParamHelper(ap, "recurrence_id", item.recurrenceId);
                     ap.item_id = item.id;
                     ap.data = (att.uri ? att.uri.spec : "");
                     ap.format_type = att.formatType;
                     ap.encoding = att.encoding;