rem:    var parts = responseText.split("\n"); results = parts[1] ? parts[1].split(",") : []; for (var i = 0; i < results.length; ++i) { results[i] = unescape(results[i]); results[i] = results[i].substr(1, results[i].length - 2); } } 
add: try { var status = this._request.status; } catch (e) {  return; } 
context:   onReadyStateChange: function() {    // xxx use the real const here    if (this._request && this._request.readyState == 4) {      try {        var status = this._request.status;      }      catch (e) {        // The XML HttpRequest can throw NS_ERROR_NOT_AVAILABLE.        return;      }      var responseText = this._request.responseText;      if (status == 200 && responseText != "") {        var searchString, results, queryURLs;        var searchService =           Components.classes["@mozilla.org/browser/search-service;1"]                    .getService(Components.interfaces.nsIBrowserSearchService);        var sandboxHost = "http://" + searchService.currentEngine.suggestionURI.host;        var sandbox = new Components.utils.Sandbox(sandboxHost);        var results2 = Components.utils.evalInSandbox(responseText, sandbox);                if (results2[0]) {          searchString = results2[0] ? results2[0] : "";          results = results2[1] ? results2[1] : [];        }        else {           // this is backwards compat code for Google Suggest, to be removed          // once they shift to the new format          // The responseText is formatted like so:          // searchString\n"r1","r2","r3"\n"c1","c2","c3"\n"p1","p2","p3"          // ... where all values are escaped:          //  rX = result  (search term or URL)          //  cX = comment (number of results or page title)          //  pX = prefix          // Note that right now we're using the "comment" column of the          // autocomplete dropdown to indicate where the suggestions          // begin, so we're discarding the comments from the server.          var parts = responseText.split("\n");          results = parts[1] ? parts[1].split(",") : [];          for (var i = 0; i < results.length; ++i) {            results[i] = unescape(results[i]);            results[i] = results[i].substr(1, results[i].length - 2);          }        }        var comments = [];  // "comments" column values for suggestions        var historyResults = [];        var historyComments = [];        // If form history is enabled and has results, add them to the list.        if (this._includeFormHistory && this._formHistoryResult &&            (this._formHistoryResult.searchResult ==             Components.interfaces.nsIAutoCompleteResult.RESULT_SUCCESS)) {          for (var i = 0; i < this._formHistoryResult.matchCount; ++i) {            var term = this._formHistoryResult.getValueAt(i);            // we don't want things to appear in both history and suggestions            var dupIndex = results.indexOf(term);            if (dupIndex != -1)              results.splice(dupIndex, 1);            historyResults.push(term);            historyComments.push("");          }          this._formHistoryResult = null;        }        // fill out the comment column for the suggestions        for (var i = 0; i < results.length; ++i)          comments.push("");        // if we have any suggestions, put a label at the top        if (comments.length > 0)          comments[0] = this._strings.GetStringFromName("suggestion_label");        // now put the history results above the suggestions        var finalResults = historyResults.concat(results);        var finalComments = historyComments.concat(comments);        // Notify the FE of our new results        this.onResultsReady(searchString, finalResults, finalComments);        // Reset our state for next time.         this._reset();      }    }  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/974e87d5d5eb2d61db2ef78df939f8e9d2148a74/nsSearchSuggestions.js/buggy/browser/components/search/nsSearchSuggestions.js