Igor Tandetnik wrote:
tradiate <[EMAIL PROTECTED]> wrote:
// JavaScript
var arr = myComponent.getArray({});
Thanks, Igor.  This is very close to what I need.  Is there a way to
set things up so that the JS code doesn't have to be coded as
xxx.getArray({})?  I'd like to lose the {} in the parm list

I'd like to myself, but I don't know of any way to do that. XPConnect requires that "out count" parameter, and even though the script can ignore it (it's available via arr.length) it still has to provide the placeholder for it. Otherwise XPConnect complains about parameter mismatch.

I'm afraid this is as clean as it gets. An alternative would be returning something like nsISupportsArray, which is a royal pain for the script to work with.

There's also nsIArray. I actually document array handling on my XPCOM Cheat Sheet - which is actually intended as more of a rosetta stone (I didn't know the term when I wrote it).
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to