rem: var thread = Cc["@mozilla.org/thread-manager;1"] .getService() .currentThread; 
add: var thread = gThreadManager.currentThread; 
context: function server(port, basePath){  if (basePath)  {    var lp = Cc["@mozilla.org/file/local;1"]               .createInstance(Ci.nsILocalFile);    lp.initWithPath(basePath);  }  // if you're running this, you probably want to see debugging info  DEBUG = true;  var srv = new nsHttpServer();  if (lp)    srv.registerDirectory("/", lp);  srv.start(port);  var thread = Cc["@mozilla.org/thread-manager;1"]                 .getService()                 .currentThread;  while (!srv.isStopped())    thread.processNextEvent(true);  // get rid of any pending requests  while (thread.hasPendingEvents())    thread.processNextEvent(true);  DEBUG = false;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/83ffd0f377352f73cd8d129e6518b12639a482e4/httpd.js/buggy/netwerk/test/httpserver/httpd.js