Check out Dart's iterators
Oliver Hunt
oliver at apple.com
Mon Feb 11 10:47:30 PST 2013
On Feb 11, 2013, at 10:35 AM, Domenic Denicola <domenic at domenicdenicola.com> wrote:
> From: es-discuss-bounces at mozilla.org [es-discuss-bounces at mozilla.org] on behalf of Oliver Hunt [oliver at apple.com]
>
>> For now I would say that we shouldn't expose the internal implementation behaviour of yield (which is what being able to explicitly create or call a generator produces). That fairly trivially resolves the StopIteration behaviour by pushing it out of the ES6 spec. If there's enough demand for manually creating or 'calling' a generator then we can fix it in ES6.x/7
>
> Would this prevent TaskJS from working in ES6?
>
> If so, I'm so sorry I started this thread, I take it all back!!!!!! :P
I'm not sure what you're talking about here - if a framework is using for(of) or yield they shouldn't need to create custom generators (at a very basic overview a JS implementation of pseudo yield is unlikely to be able to beat what the JS engine+runtime will be able to do), and if you're unable to use yield or for(of) due to backwards compat concerns then you are already implementing custom generator like behaviour that has no engine/runtime/syntax dependencies.
--Oliver
More information about the es-discuss
mailing list