Fix bug 751925 - Warning "octal literals and octal escape sequences are deprecated" in datetimepickers.xml. r=ssitter
authorPhilipp Kewisch <mozilla@kewis.ch>
Thu, 24 May 2012 08:37:25 +0700
changeset 12217 ae4c74d92fd19bd371082c2bbd9dd5451b443c79
parent 12216 2769eaf6b5bf1ea7c67c4bebd2427613bca8563c
child 12218 d0c13c84ee7e115c10f3a154daab17368818ffdd
push id599
push usermconley@mozilla.com
push dateMon, 16 Jul 2012 20:33:12 +0000
treeherdercomm-beta@c3489d5b7b65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersssitter
bugs751925
Fix bug 751925 - Warning "octal literals and octal escape sequences are deprecated" in datetimepickers.xml. r=ssitter
calendar/base/content/widgets/calendar-list-tree.xml
calendar/base/content/widgets/calendar-widgets.xml
calendar/providers/wcap/calWcapCalendarItems.js
calendar/resources/content/datetimepickers/datetimepickers.xml
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -812,17 +812,17 @@
           let oldIndex = -1;
           for (let i = 0; i < this.mCalendarList.length; i++) {
               if (this.mCalendarList[i].id == dragCalId) {
                   oldIndex = i;
                   break;
               }
           }
           if (oldIndex < 0) {
-              return;
+              return false;
           }
 
           // If no row is specified (-1), then assume append.
           let row = (aRow < 0 ? this.mCalendarList.length - 1 : aRow);
           let targetIndex = row + Math.max(0, aOrientation);
 
           // We don't need to move if the target row has the same index as the old
           // row. The same goes for dropping after the row before the old row or
--- a/calendar/base/content/widgets/calendar-widgets.xml
+++ b/calendar/base/content/widgets/calendar-widgets.xml
@@ -209,16 +209,18 @@
         <parameter name="aAttribute"/>
         <parameter name="amode"/>
         <body><![CDATA[
             if (this.hasAttribute(aModeAttribute)) {
                 let lMode = amode || this.currentMode;
                 let modeAttributeValues = this.getAttribute(aModeAttribute).split(",");
                 let modes = this.getAttribute("mode").split(",");
                 return modeAttributeValues[modes.indexOf(lMode)];
+            } else {
+                return "";
             }
         ]]></body>
       </method>
 
       <method name="setVisible">
         <parameter name="aVisible"/>
         <parameter name="aPushModeCollapsedAttribute"/>
         <parameter name="aNotifyRefControl"/>
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -914,23 +914,21 @@ calWcapCalendar.prototype.parseItems = f
             }
             case "VTODO": {
                 this.patchTimezone(subComp, "dueTime", dtstart ? dtstart.timezone : "X-NSCP-DUE-TZID");
                 item = createTodo();
                 item.icalComponent = subComp;
                 switch (itemFilter & calICalendar.ITEM_FILTER_COMPLETED_ALL) {
                     case calICalendar.ITEM_FILTER_COMPLETED_YES:
                         if (!item.isCompleted) {
-                            delete item;
                             item = null;
                         }
                         break;
                     case calICalendar.ITEM_FILTER_COMPLETED_NO:
                         if (item.isCompleted) {
-                            delete item;
                             item = null;
                         }
                         break;
                 }
                 break;
             }
         }
         if (item) {
--- a/calendar/resources/content/datetimepickers/datetimepickers.xml
+++ b/calendar/resources/content/datetimepickers/datetimepickers.xml
@@ -1563,21 +1563,21 @@
             // which do not match \w, esp. in CJK locales.)
             this.parseShortDateRegex = /^\D*(\d+)\D+(\d+)\D+(\d+)\D?$/;
             var probeDate = new Date(2002,3-1,4); // month is 0-based
             var probeString = this.formatDate(probeDate);
             var probeArray = this.parseShortDateRegex.exec(probeString);
             if (probeArray != null) { 
               // Numeric month format
               for (var i = 1; i <= 3; i++) { 
-                switch (Number(probeArray[i])) {
-                  case 02:    this.twoDigitYear = true; // fall thru
-                  case 2002:  this.yearIndex = i;       break;
-                  case 3:     this.monthIndex = i;      break;
-                  case 4:     this.dayIndex = i;        break;
+                switch (probeArray[i]) {
+                  case "02":    this.twoDigitYear = true; // fall thru
+                  case "2002":  this.yearIndex = i;       break;
+                  case "3":     this.monthIndex = i;      break;
+                  case "4":     this.dayIndex = i;        break;
                 }
               }
               // All three indexes are set (not -1) at this point.
               this.probeSucceeded = true;
             } else {
               // SHORT DATE WITH ALPHABETIC MONTH, such as "dd MMM yy" or "MMMM dd, yyyy"
               // (\d+|[^\d\W]) is digits or letters, not both together.
               // Allows 31dec1999 (no delimiters between parts) if OS does (w2k does not).
@@ -1585,20 +1585,20 @@
               // (Only accepts ASCII month names; JavaScript RegExp does not have an
               // easy way to describe unicode letters short of a HUGE character range
               // regexp derived from the Alphabetic ranges in 
               // http://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt)
               this.parseShortDateRegex = /^\s*(\d+|[^\d\W]+)\W{0,2}(\d+|[^\d\W]+)\W{0,2}(\d+|[^\d\W]+)\s*$/;
               probeArray = this.parseShortDateRegex.exec(probeString);
               if (probeArray != null) {
                 for (var j = 1; j <= 3; j++) { 
-                  switch (Number(probeArray[j])) {
-                    case 02:    this.twoDigitYear = true; // fall thru
-                    case 2002:  this.yearIndex = j;       break;
-                    case 4:     this.dayIndex = j;        break;
+                  switch (probeArray[j]) {
+                    case "02":    this.twoDigitYear = true; // fall thru
+                    case "2002":  this.yearIndex = j;       break;
+                    case "4":     this.dayIndex = j;        break;
                     default:    this.monthIndex = j;      break;
                   }
                 }
                 if (this.yearIndex != -1 && this.dayIndex != -1 && this.monthIndex != -1) {
                   this.probeSucceeded = true;
                   // Fill this.alphaMonths with month names.
                   this.alphaMonths = new Array(12);
                   for (var m = 0; m < 12; m++) {