rem: var icalStr = icalendarString; 
context: function parseIcalData( icalendarString ){   var calendarEventArray =  new Array();   var i,j;   var icalStr = icalendarString;   while( icalStr.indexOf("BEGIN:VEVENT") != -1 )   {       // try to find the begin and end of an event. ParseIcalString does not support VCALENDAR      i = icalStr.indexOf("BEGIN:VEVENT");      j = icalStr.indexOf("END:VEVENT") + 10;      var eventData = icalStr.substring(i, j);      var calendarEvent = createEvent();      // if parsing import iCalendar failed, add date as description      if ( !calendarEvent.parseIcalString(eventData) )      {         // initialize start and end dates.         initCalendarEvent( calendarEvent );         // Save the parsed text as description.         calendarEvent.description = icalStr;            }      calendarEventArray[ calendarEventArray.length ] = calendarEvent;      // remove the parsed VEVENT from the calendar data to parse      icalStr = icalStr.substring(j+1);   }   icalStr = icalendarString;   while( icalStr.indexOf("BEGIN:VTODO") != -1 )   {       // try to find the begin and end of an task. ParseIcalString does not support VCALENDAR      i = icalStr.indexOf("BEGIN:VTODO");      j = icalStr.indexOf("END:VTODO") + 9;      var todoData = icalStr.substring(i, j);      var calendarTodo = createToDo();      // if parsing import iCalendar failed, add date as description      if ( !calendarTodo.parseTodoIcalString(todoData) )      {         // Save the parsed text as description.         calendarTodo.description = icalStr;            }      calendarEventArray[ calendarEventArray.length ] = calendarTodo;      // remove the parsed VTODO from the calendar data to parse      icalStr = icalStr.substring(j+1);   }   return calendarEventArray;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3695d25011dcef893558e608a119f2c87590cd2f/calendarImportExport.js/buggy/calendar/resources/content/calendarImportExport.js