rem: for( var eventArrayIndex = 1;  eventArrayIndex < calendarEventArray.length; ++eventArrayIndex ) 
add: for( eventArrayIndex = 1;  eventArrayIndex < calendarEventArray.length; ++eventArrayIndex ) 
context: function eventArrayToICalString( calendarEventArray, doPatchForExport ){      if( !calendarEventArray)      calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;   var doMerge = doPatchForExport;   if (doPatchForExport && calendarEventArray.length > 0)    {     // will merge into one VCALENDAR if all events have same method     var firstMethod = calendarEventArray[0].method;     for( var eventArrayIndex = 1;  eventArrayIndex < calendarEventArray.length; ++eventArrayIndex )     {       if (calendarEventArray[eventArrayIndex].method != firstMethod)       {         doMerge = false;         break;       }     }   }   var eventStrings = new Array(calendarEventArray.length);   for( var eventArrayIndex = 0;  eventArrayIndex < calendarEventArray.length; ++eventArrayIndex )   {      var calendarEvent = calendarEventArray[ eventArrayIndex ].clone();            // convert time to represent local to produce correct DTSTART and DTEND      if(calendarEvent.allDay != true)         convertLocalToZulu( calendarEvent );            // check if all required properties are available      if( calendarEvent.method == 0 )         calendarEvent.method = calendarEvent.ICAL_METHOD_PUBLISH;      if( calendarEvent.stamp.year ==  0 )         calendarEvent.stamp.setTime( new Date() );      var eventString = calendarEvent.getIcalString();      if ( doPatchForExport )      {         if (doMerge)        {          // include VCALENDAR version, prodid, method only on first component          var begin = (eventArrayIndex == 0                       ? 0                       : eventString.indexOf("BEGIN:", 15+eventString.indexOf("BEGIN:VCALENDAR")));          // include END:VCALENDAR only on last component          var end = (eventArrayIndex == calendarEventArray.length - 1                     ? eventString.length                     : eventString.lastIndexOf("END:VCALENDAR"));          // Include components between begin and end.          // (Since times are all Zulu times, no VTIMEZONEs are expected,          // so safe to assume no duplicate VTIMEZONES need to be removed.)          eventString = eventString.slice(begin, end);        }        // patch TRIGGER for Outlook compatibility (before \r\n fix)        eventString = patchICalStringForExport(eventString);        // make sure all line terminators are full \r\n as required by rfc2445        eventString = eventString.replace(/\r\n|\n|\r/g, "\r\n");      }      // collect result in array, will join at end      eventStrings[eventArrayIndex] = eventString;   }   // concatenate all at once to avoid excess string copying on long calendars.   return eventStrings.join("");}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/180803fc2e09e2217a7d3f4336bbe00b271aeace/importExport.js/buggy/calendar/resources/content/importExport.js