add: if (list.cancelled) { if (list.done) { /* The server is no longer throwing stuff at us, so now * we can safely kill the list. */ network.display(getMsg(MSG_LIST_END, [list.displayed, list.count])); delete network._list; } else { /* We cancelled the list, but we're still getting data. * Handle that data, but don't display, and do it more * slowly, so we cause less lag. */ setTimeout(outputList, 1000, network); } return; } 
context: function my_list_init (){    const NORMAL_FILE_TYPE = Components.interfaces.nsIFile.NORMAL_FILE_TYPE;    function checkEndList (network)    {        if (network._list.count == network._list.lastLength)        {            network.on323();        }        else        {            network._list.lastLength = network._list.count;            network._list.endTimeout =                setTimeout(checkEndList, 5000, network);        }    }    function outputList (network)    {        const CHUNK_SIZE = 5;        var list = network._list;        if (list.length > list.displayed)        {            var start = list.displayed;            var end = list.length;            if (end - start > CHUNK_SIZE)                end = start + CHUNK_SIZE;            for (var i = start; i < end; ++i)                network.displayHere (getMsg(MSG_FMT_CHANLIST, list[i]), "322");            list.displayed = end;        }        if (list.done && (list.displayed == list.length))        {            if (list.event323)            {                var length = list.event323.params.length;                network.displayHere (list.event323.params[length - 1], "323");            }            network.displayHere(getMsg(MSG_LIST_END,                                       [list.displayed, list.count]));            delete network._list;        }        else        {            setTimeout(outputList, 250, network);        }    }    if (!("_list" in this))    {        this._list = new Array();        this._list.string = MSG_UNKNOWN;        this._list.regexp = null;        this._list.done = false;        this._list.count = 0;    }    if ("saveTo" in this._list)    {        var file = new LocalFile(this._list.saveTo);        if (!file.localFile.exists())        {            // futils.umask may be 0022. Result is 0644.            file.localFile.create(NORMAL_FILE_TYPE, 0666 & ~futils.umask);        }        this._list.file = new LocalFile(file.localFile, ">");    }    else    {        this._list.displayed = 0;        if (client.currentObject != this)            display (getMsg(MSG_LIST_REROUTED, this.unicodeName));        setTimeout(outputList, 250, this);    }    this._list.lastLength = 0;    this._list.endTimeout = setTimeout(checkEndList, 5000, this);}
meta: 1567	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1567/985f40349f8a8430c91fcf27719da2e2155240dc/handlers.js/buggy/xul/content/handlers.js