rem: query = queries[i].firstChild.nodeValue; 
add: debug.print(label + "restoring " + i + queries[i]); query = queries[i].hasChildNodes() ? queries[i].firstChild.nodeValue : null; 
context:     this.restore = function() {        var restore = $(this.restoreId);        var label = "SessionClass.restore: ";        debug.print(label + restore + " " + restore.hasChildNodes());        //alert(label + restore + " " + restore.hasChildNodes());        if (null == restore) {          debug.print(label + "null restore");          this.tabs.refresh();          return;        }        // handle session uri cookie        var uri = restore.getAttribute('uri');        if (null != uri) {            this.syncDisabled = false;            setCookie(gSessionUriCookie, uri);            debug.print(label + "set session cookie = " + uri);        } else {            debug.print(label + "missing session uri!");            this.syncDisabled = true;        }        // handle exposed tab        var activeTab = restore.getAttribute('active-tab');        this.tabs.refresh(activeTab);        if (restore.hasChildNodes()) {            var children = restore.childNodes;            debug.print(label + "children = " + children);            var queries = null;            var query = null;            var source = null;            // first div is the buffers            var buffers = children[0];            debug.print(label + "buffers = " + buffers);            // handle rows and cols (global)            this.buffers.setRows(buffers.getAttribute('rows'));            this.buffers.setCols(buffers.getAttribute('cols'));            queries = buffers.childNodes;            debug.print(label + "queries = " + queries);            debug.print(label + "restoring buffers " + queries.length);            for (var i = 0; i < queries.length; i++) {                query = queries[i].firstChild.nodeValue;                //debug.print(label + "restoring " + i + " " + query);                // handle content-source (per buffer)                source = queries[i].getAttribute('content-source');                debug.print(label + "restoring " + i + " source = " + source);                this.buffers.add(query, source);            }            // reactivate active buffer            var active = buffers.getAttribute('active');            debug.print(label + "buffers active = " + active);            this.buffers.activate(active);            // second div is the history            var history = children[1];            queries = history.childNodes;            debug.print(label + "restoring history " + queries.length);            // restore in reverse order            for (var i = queries.length; i > 0; i--) {                query = queries[ i - 1 ].firstChild.nodeValue;                //debug.print(label + "restoring " + i + " " + query);                this.history.add(query);            }        }    }
meta: 952	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/952/fa73b32cceb4f0083ba3aeb2e77c3b68663bf56d/session.js/clean/session.js