rem: debug("finishImport: theList = " + theList.innerHTML + ", length = " + theList.length); 
add: debug.print("finishImport: theList = " + theList.length); 
context: function finishImport() {    debug('finishImport: checking for output');    var theOutput = getResultFrame();    debug("finishImport: theOutput = " + theOutput);    if (theOutput == null)        return;    var theOutputDoc = theOutput.contentDocument;    if (is.ie)        theOutputDoc = theOutput.contentWindow.document;    // no document? no results...    if (theOutputDoc == null)        return;    // now check for buffers    var theList = null;    if (is.ie && theOutputDoc.XMLDocument) {        debug("finishImport: ie, using XMLDocument");        theList = theOutputDoc.XMLDocument.getElementsByTagName            (g_cq_buffer_basename);    } else {        theList =            theOutputDoc.getElementsByTagName(g_cq_buffer_basename);    }    // if we timed out, try again    var theTimeout = null;    if (theList == null || theList.length < 1) {        debug("finishImport: no list: setting new timeout " + g_cq_timeout);        theTimeout = setTimeout('finishImport();', g_cq_timeout);        return null;    }    clearTimeout(theTimeout);    // TODO if the imported worksheet has rows/cols attributes, use them    if (is.gecko) {        // gecko has a problem with nodeValue longer than 4kB (encoded):        // it creates multiple text-node children.        // this is a DOM violation, but won't be fixed for some time.        // see https://bugzilla.mozilla.org/show_bug.cgi?id=194231        // workaround: call normalize() early        debug("finishImport: gecko workaround");        theOutputDoc.normalize();    }    debug("finishImport: theList = " + theList.innerHTML + ", length = " + theList.length);    var theValue = null;    for (var i = 0; i < theList.length; i++) {        if (theList[i] == null || theList[i].firstChild == null)            continue;        // TODO remove decode if encode isn't needed?        theValue = decodeURIComponent( (theList[i]).firstChild.nodeValue );        debug("finishImport: buffer i = " + i + ", " + theValue.length + ": " + theValue);        getBuffer(i).value = theValue;    } // for theList    // import query history too, by appending    //clearQueryHistory();    var historyNode = document.getElementById(g_cq_history_node);    if (! historyNode) {        debug("finishImport: null historyNode");    } else {        var theList = theOutputDoc.getElementsByTagName(g_cq_history_basename);        for (var i = 0; i < theList.length ; i++) {            if (g_cq_history_limit != null && i > g_cq_history_limit)                break;            if (theList[i].firstChild == null)                continue;            // TODO remove decode if encode isn't needed?            theValue = decodeURIComponent( (theList[i]).firstChild.nodeValue );            saveQueryHistory(theValue, true);        }    }    // leave the user in the same buffer    refreshBufferList(g_cq_buffer_current, "finishImport");    var theUri = document.getElementById(g_cq_uri).value;    var theQuery = '<p>' + theUri + ' imported</p>';    submitForm(document.getElementById(g_cq_query_form_id),               theQuery, "text/html");} // finishImport
meta: 952	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/952/499e513a3cc333dbcb784318ca05ad90a90b7c8e/cq.js/clean/cq.js