rem: var respFunc = function( wcapResponse ) { this_.getItems_resp( wcapResponse, 0, 1, null, null, iListener ); }; 
add: var syncResponseFunc = function( wcapResponse ) { var icalRootComp = wcapResponse.data; var items = this_.parseItems( icalRootComp, Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS, 1, null, null ); if (items.length < 1) throw new Error("no such item!"); if (items.length > 1) { this_.notifyError( "unexpected number of items: " + items.length ); } item = items[0]; if (iListener != null) { iListener.onGetResult( this_.superCalendar, Components.results.NS_OK, Components.interfaces.calIItemBase, this_.log( "getItems_resp(): success." ), items.length, items ); iListener.onOperationComplete( this_.superCalendar, Components.results.NS_OK, Components.interfaces.calIOperationListener.GET, items.length == 1 ? items[0].id : null, null ); } this_.log( "item delivered." ); };  
context: calWcapCalendar.prototype.getItem = function( id, iListener ){    // xxx todo: test    // xxx todo: howto detect whether to call    //           fetchevents_by_id ot fetchtodos_by_id?    //           currently drag/drop is implemented for events only,    //           try events first, fallback to todos... in the future...    this.log( ">>>>>>>>>>>>>>>> getItem() call!");    try {        var this_ = this;        var respFunc = function( wcapResponse ) {                           this_.getItems_resp( wcapResponse,                                                0, 1, null, null, iListener );                       };        var params = "&compressed=1&recurring=1&fmt-out=text%2Fcalendar";        params += ("&calid=" + encodeURIComponent(this.calId));        params += ("&uid=" + id);        try {            // most common: event            this.issueAsyncRequest(                this.getCommandUrl( "fetchevents_by_id" ) + params,                utf8ToIcal, respFunc );        }        catch (exc) {            // try again, may be a task:            this.issueAsyncRequest(                this.getCommandUrl( "fetchtodos_by_id" ) + params,                utf8ToIcal, respFunc );        }    }    catch (exc) {        if (iListener != null) {            iListener.onOperationComplete(                this.superCalendar, Components.results.NS_ERROR_FAILURE,                Components.interfaces.calIOperationListener.GET,                null, exc );        }        this.notifyError( exc );    }    this.log( "getItem() returning." );};
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/99eaaaada9e6f5f2a2f7fac9237c6e41ecf1eef7/calWcapCalendarItems.js/buggy/calendar/providers/wcap/calWcapCalendarItems.js