Yes, that's where I'm stuck.

Here are the few variations I tired :

```
function* FileReader(){
    // Some stream code on node;
    stream.on('data',yield function*(data) {
          yield data;
    });
}

function* FileReader(){
    // Some stream code on node;
    yield stream.on('data',function*(data) {
          yield data;
    });
}

function* FileReader(){
    // Some stream code on node;
   var res = ' ';
    stream.on('data',function(data) {
          res = data;
    });
    yield res;
}
```
Creating an iterator for the parent generators will not help to iterator
over the nested/child anonymous generators?



On Sat, Dec 7, 2013 at 10:13 PM, Brendan Eich <[email protected]> wrote:

> Hemanth H.M wrote:
>
>> function* FileReader(){
>>     // Some stream code on node;
>>     stream.on('data',function*(data) {
>>           yield data;
>>     });
>> }
>> ```
>> Now :
>>
>> ```
>> var reader = FileReader();
>> console.log(reader.next()); // Would say { value: undefined, done: true }
>>
>
> The FileReader generator is yield-free. Seems like a bug in that code.
>
> /be
>



-- 
*'I am what I am because of who we all are'*
h3manth.com <http://www.h3manth.com>
*-- Hemanth HM *
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to