rem: this.mMemoryCalendar.wrappedJSObject.calendarToReturn = this; 
add: this.mMemoryCalendar.superCalendar = this; 
context:     onStreamComplete: function(loader, ctxt, status, resultLength, result)    {        // No need to do anything if there was no result        if (!resultLength) {            this.unlock();            return;        }                // Allow the hook to get needed data (like an etag) of the channel        var cont = this.mHooks.onAfterGet();        if (!cont) {            this.unlock();            return;        }        // This conversion is needed, because the stream only knows about        // byte arrays, not about strings or encodings. The array of bytes        // need to be interpreted as utf8 and put into a javascript string.        var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]                                         .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);        // ics files are always utf8        unicodeConverter.charset = "UTF-8";        var str;        try {            str = unicodeConverter.convertFromByteArray(result, result.length);        } catch(e) {            this.mObserver.onError(calIErrors.CAL_UTF8_DECODING_FAILED, e.toString());            this.unlock();            return;        }        // Create a new calendar, to get rid of all the old events        this.mMemoryCalendar = Components.classes["@mozilla.org/calendar/calendar;1?type=memory"]                                         .createInstance(Components.interfaces.calICalendar);        this.mMemoryCalendar.uri = this.mUri;        this.mMemoryCalendar.wrappedJSObject.calendarToReturn = this;        this.mObserver.onStartBatch();        // Wrap parsing in a try block. Will ignore errors. That's a good thing        // for non-existing or empty files, but not good for invalid files.        // That's why we put them in readOnly mode        try {            var parser = Components.classes["@mozilla.org/calendar/ics-parser;1"].                                    createInstance(Components.interfaces.calIIcsParser);            parser.parseString(str);            var items = parser.getItems({});                        for each (var item in items) {                this.mMemoryCalendar.adoptItem(item, null);            }            this.unmappedComponents = parser.getComponents({});            this.unmappedProperties = parser.getProperties({});        } catch(e) {            LOG("Parsing the file failed:"+e);            this.mObserver.onError(e.result, e.toString());        }        this.mObserver.onEndBatch();        this.mObserver.onLoad(this);                // Now that all items have been stuffed into the memory calendar        // we should add ourselves as observer. It is important that this        // happens *after* the calls to adoptItem in the above loop to prevent        // the views from being notified.        this.mMemoryCalendar.addObserver(this.mObserver);                this.unlock();    },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/55570678242646ac6b381fe29963ff1a57c74bc4/calICSCalendar.js/clean/calendar/providers/ics/calICSCalendar.js