rem: var sTextiCalendar = ""; 
add: var doMerge = doPatchForExport; if (doPatchForExport && calendarEventArray.length > 0) {  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); 
context: function eventArrayToICalString( calendarEventArray, doPatchForExport ){      if( !calendarEventArray)      calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;   var sTextiCalendar = "";   for( var eventArrayIndex = 0;  eventArrayIndex < calendarEventArray.length; ++eventArrayIndex )   {      try      {         var calendarEvent = calendarEventArray[ eventArrayIndex ].clone();      }      catch( e )      {         alert( "Caught an exception in eventArrayToICalString, while trying to clone the event, it was: \n"+e );      }            // 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() );      if ( doPatchForExport )        sTextiCalendar += patchICalStringForExport( calendarEvent.getIcalString() );      else        sTextiCalendar += calendarEvent.getIcalString() ;   }      return sTextiCalendar;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/8ba2a8698498a5260481127823ac0e0e0d265a6f/importExport.js/buggy/calendar/resources/content/importExport.js