rem: if (aTarget.parent.Value == "NC:BookmarksTopRoot") return false;  
context:   isCommandEnabled: function (aCommand, aSelection, aTarget)  {    if (aTarget.parent.Value == "NC:BookmarksTopRoot")      return false;    var item0, type0;    var length = aSelection.length;    if (length != 0) {      item0 = aSelection.item[0].Value;      type0 = aSelection.type[0];    }    var i;    switch(aCommand) {    case "cmd_undo":    case "cmd_redo":    case "cmd_bm_undo":    case "cmd_bm_redo":      return true;    case "cmd_bm_paste":      if (!BookmarksUtils.isValidTargetContainer(aTarget.parent))        return false;      const kClipboardContractID = "@mozilla.org/widget/clipboard;1";      const kClipboardIID = Components.interfaces.nsIClipboard;      var clipboard = Components.classes[kClipboardContractID].getService(kClipboardIID);      const kSuppArrayContractID = "@mozilla.org/supports-array;1";      const kSuppArrayIID = Components.interfaces.nsISupportsArray;      var flavourArray = Components.classes[kSuppArrayContractID].createInstance(kSuppArrayIID);      const kSuppStringContractID = "@mozilla.org/supports-cstring;1";      const kSuppStringIID = Components.interfaces.nsISupportsCString;          var flavours = ["moz/bookmarkclipboarditem", "text/x-moz-url"];      for (i = 0; i < flavours.length; ++i) {        const kSuppString = Components.classes[kSuppStringContractID].createInstance(kSuppStringIID);        kSuppString.data = flavours[i];        flavourArray.AppendElement(kSuppString);      }      var hasFlavours = clipboard.hasDataMatchingFlavors(flavourArray, kClipboardIID.kGlobalClipboard);      return hasFlavours;    case "cmd_bm_copy":      return length > 0;    case "cmd_bm_cut":      return true;    case "cmd_bm_delete":      return length > 0 && aSelection.containsMutable && !aSelection.containsPTF;    case "cmd_bm_selectAll":      return true;    case "cmd_bm_open":    case "cmd_bm_expandfolder":    case "cmd_bm_managefolder":      return length == 1;    case "cmd_bm_openinnewwindow":    case "cmd_bm_openinnewtab":      return true;    case "cmd_bm_openfolder":      for (i=0; i<length; ++i) {        if (aSelection.type[i] == ""         ||            aSelection.type[i] == "Bookmark" ||            aSelection.type[i] == "BookmarkSeparator")          return false;        RDFC.Init(BMDS, aSelection.item[i]);        var children = RDFC.GetElements();        while (children.hasMoreElements()) {          if (BookmarksUtils.resolveType(children.getNext()) == "Bookmark")            return true;        }      }      return false;    case "cmd_bm_import":    case "cmd_bm_export":      return true;    case "cmd_bm_newbookmark":    case "cmd_bm_newfolder":    case "cmd_bm_newseparator":      return BookmarksUtils.isValidTargetContainer(aTarget.parent);    case "cmd_bm_properties":    case "cmd_bm_rename":      return length == 1;    case "cmd_bm_setnewbookmarkfolder":      if (length != 1)         return false;      return item0 != "NC:NewBookmarkFolder"     &&             (type0 == "Folder" || type0 == "PersonalToolbarFolder");    case "cmd_bm_setpersonaltoolbarfolder":      if (length != 1)        return false;      return item0 != "NC:PersonalToolbarFolder" && type0 == "Folder";    case "cmd_bm_setnewsearchfolder":      if (length != 1)        return false;      return item0 != "NC:NewSearchFolder"       &&              (type0 == "Folder" || type0 == "PersonalToolbarFolder");    case "cmd_bm_movebookmark":      return length > 0;    default:      return false;    }  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/da1d3f24d4e18696b0a03b143c18126d06413bb0/bookmarks.js/buggy/browser/components/bookmarks/content/bookmarks.js