rem: var uriToAdd  = ioService.newURI(urlToAdd, null); 
add:  try { var uriToAdd  = ioService.newURI(urlToAdd, null); } catch(e) {   } 
context: function addToUrlbarHistory(){  var urlToAdd = gURLBar.value;  if (!urlToAdd)     return;  if (localstore) {       var entries = rdfc.MakeSeq(localstore, rdf.GetResource("nc:urlbar-history"));       if (!entries)          return;       var elements = entries.GetElements();       if (!elements)          return;       var index = 0;       // create the nsIURI objects for comparing the 2 urls       var ioService = Components.classes["@mozilla.org/network/io-service;1"]                     .getService(Components.interfaces.nsIIOService);              try {         var unused = { };         var scheme = ioService.extractScheme(urlToAdd, unused, unused);       } catch(e) {        urlToAdd = "http://" + urlToAdd;       }       var uriToAdd  = ioService.newURI(urlToAdd, null);       while(elements.hasMoreElements()) {          entry = elements.getNext();          if (entry) {             index ++;             entry= entry.QueryInterface(Components.interfaces.nsIRDFLiteral);             var rdfValue = entry.Value;             try {               var unused = { };               var scheme = ioService.extractScheme(rdfValue, unused, unused);             } catch(e) {                rdfValue = "http://" + rdfValue;            }             var rdfUri = ioService.newURI(rdfValue, null);                          if (rdfUri.equals(uriToAdd)) {                 // URI already present in the database                 // Remove it from its current position.                 // It is inserted to the top after the while loop.                 entries.RemoveElementAt(index, true);                 break;             }          }       }   // while       var entry = rdf.GetLiteral(urlToAdd);       // Otherwise, we've got a new URL in town. Add it!       // Put the value as it was typed by the user in to RDF       // Insert it to the beginning of the list.       entries.InsertElementAt(entry, 1, true);       // Remove any expired history items so that we don't let       // this grow without bound.       for (index = entries.GetCount(); index > MAX_HISTORY_ITEMS; --index) {           entries.RemoveElementAt(index, true);        }  // for   }  // localstore}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/661d25fe78a36a004c4d019e666662074b75cc8a/sessionHistoryUI.js/clean/suite/browser/sessionHistoryUI.js