rem: var moveProfileFile = function(src, dest) { 
add: var moveProfileFile = function(src, dest) { 
context: function CookieJarSelector() {  var Cc = Components.classes;  var Ci = Components.interfaces;  var getProfileFile = function(filename) {    var loc = "ProfD";  // profile directory    var file =       Cc["@mozilla.org/file/directory_service;1"]      .getService(Ci.nsIProperties)      .get(loc, Ci.nsILocalFile)      .clone();    file.append(filename);     return file;  };  var copyProfileFile = function(src, dest) {    var srcfile = getProfileFile(src);        var destfile = getProfileFile(dest);    if (srcfile.exists()) {      if (destfile.exists()) {        destfile.remove(false);      }      srcfile.copyTo(null, dest);    }  };  var moveProfileFile = function(src, dest) { // XXX: Why does this not work?    var srcfile = getProfileFile(src);        var destfile = getProfileFile(dest);    if (srcfile.exists()) {      if (destfile.exists()) {        destfile.remove(false);      }      srcfile.moveTo(null, dest);    }  };  this.clearCookies = function() {    Cc["@mozilla.org/cookiemanager;1"]    .getService(Ci.nsICookieManager)    .removeAll();  }  this.saveCookies = function(name) {    copyProfileFile("cookies.txt", "cookies-" + name + ".txt");  };  this.loadCookies = function(name, deleteSavedCookieJar) {    var cookieManager =      Cc["@mozilla.org/cookiemanager;1"]      .getService(Ci.nsICookieManager);    cookieManager.QueryInterface(Ci.nsIObserver);    // Tell the cookie manager to unload cookies from memory and disk    var context = "shutdown-cleanse";     cookieManager.observe(this, "profile-before-change", context);    // Replace the cookies.txt file with the loaded data    var fn = deleteSavedCookieJar ? moveProfileFile : copyProfileFile;    fn("cookies-" + name + ".txt", "cookies.txt");    // Tell the cookie manager to reload cookies from disk    cookieManager.observe(this, "profile-do-change", context);  };  // This JSObject is exported directly to chrome  this.wrappedJSObject = this;}
meta: 3444	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3444/6d16d2398792e6b4fdd065aeb02351a0b494ec98/cookie-jar-selector.js/buggy/src/components/cookie-jar-selector.js