Philip Chee wrote:

On Wed, 17 May 2006 09:51:55 +0100, Neil wrote:
  var containerArc;
  while (arcsIn.hasMoreElements()) {
    containerArc = arcsIn.getNext();

Nit: var containerArc = arcsIn.getNext();
I'm confused. Won't this redeclare containerArc on every loop within the while?
Actually, in JS, you can declare the variable anywhere in the function you like e.g. after the return, so the only reason I suggested it was for the style guidelines of trying to declare the variable as near to where it is first assigned, but always in a parent block of all of its uses.

      return BMDS.GetSources(containerArc, aResource, true).getNext()
                 .QueryInterface(kRDFRSCIID);

The original C++ translates to
return BMDS.GetSource(containerArc, aResource, true);
I actually stole this bit of code from:
<http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/bookmarks.js#1170>
Couldn't you have written your code to use getParentOfContainer? Anyway, assuming it still works, please consider including that simplification it in any patches you might make to that file.
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to