rem: rType = rType.QueryInterface(Components.interfaces.nsIRDFLiteral); 
add: try { rType = rType.QueryInterface(Components.interfaces.nsIRDFLiteral); } catch (e) {    const krName = this.RDF.GetResource(names[i]); const krNameProperty = this.RDF.GetResource(NC_NS + "Name"); const krBookmark = this.RDF.GetResource(NC_NS + "Bookmark"); kBMDS.Assert(rCurrent, krNameProperty, krName, true); kBMDS.Assert(rCurrent, krTypeProperty, krBookmark, true); } 
context:   paste: function (aSelection)  {    const kXferableContractID = "@mozilla.org/widget/transferable;1";    const kXferableIID = Components.interfaces.nsITransferable;    var xferable = Components.classes[kXferableContractID].createInstance(kXferableIID);    xferable.addDataFlavor("moz/bookmarkclipboarditem");    xferable.addDataFlavor("text/x-moz-url");    xferable.addDataFlavor("text/unicode");    const kClipboardContractID = "@mozilla.org/widget/clipboard;1";    const kClipboardIID = Components.interfaces.nsIClipboard;    var clipboard = Components.classes[kClipboardContractID].getService(kClipboardIID);    clipboard.getData(xferable, kClipboardIID.kGlobalClipboard);        var flavour = { };    var data = { };    var length = { };    xferable.getAnyTransferData(flavour, data, length);    var nodes = []; var names = [];    data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data;    switch (flavour.value) {    case "moz/bookmarkclipboarditem":      nodes = data.split("\n");      break;    case "text/x-moz-url":      var ix = data.value.indexOf("\n");      nodes.push(data.substring(0, ix != -1 ? ix : data.length));      names.push(data.substring(ix));      break;    default:       return;    }        const lastSelected = aSelection[aSelection.length-1];      const kParentNode = this.resolvePasteFolder(aSelection);    const krParent = this.RDF.GetResource(NODE_ID(kParentNode));    const krSource = this.RDF.GetResource(NODE_ID(lastSelected));        const kRDFCContractID = "@mozilla.org/rdf/container;1";    const kRDFCIID = Components.interfaces.nsIRDFContainer;    const ksRDFC = Components.classes[kRDFCContractID].getService(kRDFCIID);    const kBMDS = this.RDF.GetDataSource("rdf:bookmarks");    if ("beginBatch" in this && nodes.length > 1)      this.beginBatch();    var additiveFlag = false;    for (var i = 0; i < nodes.length; ++i) {      if (!nodes[i]) continue;      var rCurrent = this.RDF.GetResource(nodes[i]);      const krTypeProperty = this.RDF.GetResource(RDF_NS + "type");      var rType = this.db.GetTarget(rCurrent, krTypeProperty, true);      try {        rType = rType.QueryInterface(Components.interfaces.nsIRDFResource);      }      catch (e) {        rType = rType.QueryInterface(Components.interfaces.nsIRDFLiteral);      }      // If the node is a folder, then we need to create a new anonymous       // resource and copy all the arcs over.      if (rType.Value == NC_NS + "Folder")        rCurrent = BookmarksUtils.cloneFolder(rCurrent, krParent, krSource);      // If we are given names, this implies that the nodes do not already       // exist in the graph, and we need to create some additional information      // for them.       if (names.length) {        const krName = this.RDF.GetResource(names[i]);        const krNameProperty = this.RDF.GetResource(NC_NS + "Name");        const krBookmark = this.RDF.GetResource(NC_NS + "Bookmark");        this.db.Assert(rCurrent, krNameProperty, krName, true);        this.db.Assert(rCurrent, krTypeProperty, krBookmark, true);      }      ksRDFC.Init(kBMDS, krParent);      ix = ksRDFC.IndexOf(krSource);      if (ix != -1)         ksRDFC.InsertElementAt(rCurrent, ix+1, true);      else        ksRDFC.AppendElement(rCurrent);      this.selectFolderItem(krSource.Value, rCurrent.Value, additiveFlag);      if (!additiveFlag) additiveFlag = true;    }    if ("endBatch" in this && nodes.length > 1)      this.endBatch();  },
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/3c1e4cee57d48dad81a4af4b045f5845fa04b0f0/bookmarksOverlay.js/clean/xpfe/components/bookmarks/resources/bookmarksOverlay.js