Re: Feel free to use Iterator() in privileged JS (was: Re: Help with removing __iterator__ from JS)

2015-07-28 Thread Tom Schuster
Please remember that the ES6 iteration protocol can only be used with
for-of.
On Jul 28, 2015 1:20 PM, "Paolo Amadini"  wrote:

> On 7/23/2015 4:16 PM, Boris Zbarsky wrote:
>
>> I might be missing something, but why is __iterator__ and the
>> nonstandard iteration protocol needed for this?
>>
>
> It's not.
>
>  I don't think anyone on the SpiderMonkey end particularly cares whether
>> Iterator or some replacement is used.
>>
>
> Thanks a lot for the clarification. I was in fact replying to Tom's
> aside of "Please also try avoid using Iterator" but it's clear that
> there are use cases for it and we should use it where it makes sense.
>
> Iterator() can even be implemented easily internally using the ES6
> iterator protocol.
>
> Cheers,
> Paolo
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Feel free to use Iterator() in privileged JS (was: Re: Help with removing __iterator__ from JS)

2015-07-28 Thread Paolo Amadini

On 7/23/2015 4:16 PM, Boris Zbarsky wrote:

I might be missing something, but why is __iterator__ and the
nonstandard iteration protocol needed for this?


It's not.


I don't think anyone on the SpiderMonkey end particularly cares whether
Iterator or some replacement is used.


Thanks a lot for the clarification. I was in fact replying to Tom's
aside of "Please also try avoid using Iterator" but it's clear that
there are use cases for it and we should use it where it makes sense.

Iterator() can even be implemented easily internally using the ES6
iterator protocol.

Cheers,
Paolo
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform