rem: if (this.readOnly) { throw new Components.Exception( "Calendar is read-only.", Components.interfaces.calIErrors.CAL_IS_READONLY ); } 
add: this.assureReadWrite(); 
context: calWcapCalendar.prototype.adoptItem = function( item, listener ){    this.log( "adoptItem() call: " + item.title );    try {        if (this.readOnly) {            throw new Components.Exception(                "Calendar is read-only.",                Components.interfaces.calIErrors.CAL_IS_READONLY );        }                // xxx todo: workaround really necessary for adding an occurrence?        var oldItem = null;        if (!isParent(item)) {            this.logError( "adoptItem(): unexpected proxy!" );            debugger;            item.parentItem.recurrenceInfo.modifyException( item );            oldItem = item; // patch to modify        }                var this_ = this;        this.storeItem(            item, oldItem,            function( wcapResponse ) {                this_.adoptItem_resp( wcapResponse, listener );            } );    }    catch (exc) {        if (listener != null) {            listener.onOperationComplete(                this.superCalendar, Components.results.NS_ERROR_FAILURE,                Components.interfaces.calIOperationListener.ADD,                item.id, exc );        }        this.notifyError( exc );    }    this.log( "adoptItem() returning." );};
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/50dafc0b163e0df2f1405b136de455ba89d9f671/calWcapCalendarItems.js/buggy/calendar/providers/wcap/calWcapCalendarItems.js