On 6/24/14, 2:59 AM, Cameron McCormack wrote:
Yes hence the "something similar". :-)  Was just easiest for working
with while implementing.  Making the object iterable seems like the
right thing to do, but our bindings generation scripts don't handle
"iterator" in IDL yet.

That's at least in part because spidermonkey only has fake support for iterators so far (e.g. it uses an actual property called "@@iterator"). Similarly, the WebIDL spec talks about a property named "iterator", not Symbol.iterator.

So you could simply do that in the IDL, if IDL syntax let you have method names that are not identifiers (e.g. via some sort of escaping). ;)

That said, we already hook up an @@iterator method for things with indexed getters. So we could do that for interfaces that have an "iterator" in the IDL. We'd need to actually follow the ES6 iteration protocol, though; what's in the WebIDL spec right now seems to be based on early drafts that had StopIteration exceptions and the like.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to