rem: var childContainer = nsJSComponentManager.createInstance("@mozilla.org/rdf/container;1", "nsIRDFContainer"); childContainer.Init(childDB, dropElementRes); childContainer.AppendElement(elementRes); 
add: rdfContainer.Init(childDB, dropElementRes); rdfContainer.AppendElement(elementRes); 
context:   onDrop: function (aEvent, aData, aDragSession)     {      // temporary      if (!isPToolbarDNDEnabled())        return false;              var element = aData.data.data;      var dropElement = aEvent.target.id;      var elementRes = RDFUtils.getResource(element);      var dropElementRes = RDFUtils.getResource(dropElement);      var personalToolbarRes = RDFUtils.getResource("NC:PersonalToolbarFolder");            var childDB = document.getElementById("innermostBox").database;      var rdfContainer = nsJSComponentManager.createInstance("@mozilla.org/rdf/container;1",                                                             "nsIRDFContainer");      rdfContainer.Init(childDB, personalToolbarRes);            var elementIsOnToolbar = rdfContainer.IndexOf(elementRes);      if (elementIsOnToolbar > 0)         rdfContainer.RemoveElement(elementRes, true);      else if (dropIndex == -1)        {          // look up this URL's title in global history          var potentialTitle = null;          var historyDS = gRDFService.GetDataSource("rdf:history");          var historyEntry = gRDFService.GetResource(element);          var historyTitleProperty = gRDFService.GetResource(NC_RDF("Name"));          var titleFromHistory = historyDS.GetTarget(historyEntry, historyTitleProperty, true);          if (titleFromHistory)            titleFromHistory = titleFromHistory.QueryInterface(Components.interfaces.nsIRDFLiteral);          if (titleFromHistory)            potentialTitle = titleFromHistory.Value;          linkTitle = potentialTitle ? potentialTitle : element;          childDB.Assert(gRDFService.GetResource(element, true),                          gRDFService.GetResource(NC_RDF("Name"), true),                         gRDFService.GetLiteral(linkTitle),                         true);        }      var dropIndex = rdfContainer.IndexOf(dropElementRes);      // determine the drop position      var dropPosition = this.determineDropPosition(aEvent);      switch (dropPosition) {      case -1:        rdfContainer.InsertElementAt(elementRes, dropIndex, true);        break;      case 0:        // do something here to drop into subfolders        var childContainer = nsJSComponentManager.createInstance("@mozilla.org/rdf/container;1",                                                                 "nsIRDFContainer");        childContainer.Init(childDB, dropElementRes);        childContainer.AppendElement(elementRes);        break;      case 1:      default:        rdfContainer.InsertElementAt(elementRes, dropIndex+1, true);        break;      }      return true;    },
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/cbccb2cf5f993ed15e85e40ce47c6c281bdec975/navigatorDD.js/buggy/suite/browser/navigatorDD.js