spun-off from bug 418490, toXPCOMIterator should handle nsIArray as well.
I'm not sure this is needed - the js code needs to create an nsIMutableArray in order to put things in the array, and if you pass in the nsIMutableArray interface, you can pass the result to callers expecting an nsIArray.
The point is that the JS can create a normal array and then use the utility to convert it to an nsIArray, and can also use the utility to iterate an nsIArray.
iterating an nsIArray makes sense, but converting it to an nsIArray would mean creating an nsIMutableArray, and then I guess QI'ing that to an nsIArray, right?
nsIMutableArray inherits from nsIArray last time I looked.
Fixed in bug 698925.