rem: var len = Number(tree.getAttribute("length")); if (!len) len = -1; tree.setAttribute("length",len+1); 
add:   tree.setAttribute("length", treechildren.childNodes.length); 
context: function AppendStringToTreelist(tree, string){dump("AppendStringToTreelist: string="+string+"\n");  if (tree)  {    var treecols = tree.firstChild;    if (!treecols)    {      dump("Bad XUL: Must have <treecolgroup> as first child\n");    }    var treechildren = treecols.nextSibling;    if (!treechildren)    {      treechildren = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treechildren");      if (treechildren)      {        treechildren.setAttribute("flex","1");        tree.appendChild(treechildren);      }      else      {        dump("Failed to create <treechildren>\n");        return null;      }    }    var treeitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treeitem");    var treerow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treerow");    var treecell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treecell");    if (treeitem && treerow && treecell)    {      treerow.appendChild(treecell);      treeitem.appendChild(treerow);      treechildren.appendChild(treeitem)      treecell.setAttribute("value", string);      var len = Number(tree.getAttribute("length"));      if (!len) len = -1;      tree.setAttribute("length",len+1);      return treeitem;    }  }  return null;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/c0a534c8efb9e6703626cacd6d61cb6ad8eb6680/EdDialogCommon.js/buggy/editor/ui/dialogs/content/EdDialogCommon.js