rem: calWcapCalendar.prototype.adoptItem_resp = function( wcapResponse, newItem_, listener ) { var item = null; try { var icalRootComp = wcapResponse.data;  var items = this.parseItems( icalRootComp, Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS, 0, null, null, true /* bLeaveMutable */ ); if (items.length < 1) throw new Components.Exception("empty VCALENDAR returned!"); if (items.length > 1) this.notifyError( "unexpected number of items: " + items.length ); item = items[0]; this.tunnelXProps(item, newItem_); item.makeImmutable();  this.log( "item.id=" + item.id ); if (listener != null) { listener.onOperationComplete( this.superCalendar, Components.results.NS_OK, Components.interfaces.calIOperationListener.ADD, item.id, item ); } this.notifyObservers( "onAddItem", [item] );  } catch (exc) { if (listener != null) { listener.onOperationComplete( this.superCalendar, Components.results.NS_ERROR_FAILURE, Components.interfaces.calIOperationListener.ADD, item == null ? null : item.id, exc ); } this.notifyError( exc ); } }; 
add: function adoptItem_resp(request, err, newItem) { if (listener) { listener.onOperationComplete( this_.superCalendar, getResultCode(err), calIOperationListener.ADD, err ? item.id : newItem.id, err ? err : newItem); } if (err) this_.notifyError(err); else this_.notifyObservers("onAddItem", [newItem]); }, 
context: calWcapCalendar.prototype.adoptItem_resp = function(    wcapResponse, newItem_, listener ){    var item = null;    try {        var icalRootComp = wcapResponse.data; // first statement, may throw                var items = this.parseItems(            icalRootComp,            Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS,            0, null, null, true /* bLeaveMutable */ );        if (items.length < 1)            throw new Components.Exception("empty VCALENDAR returned!");        if (items.length > 1)            this.notifyError( "unexpected number of items: " + items.length );        item = items[0];        this.tunnelXProps(item, newItem_);        item.makeImmutable();                this.log( "item.id=" + item.id );                if (listener != null) {            listener.onOperationComplete(                this.superCalendar, Components.results.NS_OK,                Components.interfaces.calIOperationListener.ADD,                item.id, item );        }        this.notifyObservers( "onAddItem", [item] );        // xxx todo: maybe log request status    }    catch (exc) {        if (listener != null) {            listener.onOperationComplete(                this.superCalendar, Components.results.NS_ERROR_FAILURE,                Components.interfaces.calIOperationListener.ADD,                item == null ? null : item.id, exc );        }        this.notifyError( exc );    }};
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10234/a8adf4992620da379274cea3395ed3099b6769d6/calWcapCalendarItems.js/buggy/calendar/providers/wcap/calWcapCalendarItems.js