On Mar 30, 2013, at 7:05 AM, André Bargull wrote:

>> >> The most significant change from the meeting (and it really wasn't
>> >> explicit on the whiteboard) is that generator prototypes don't have a
>> >> "constructor" property that links back to its generator function instance.
>> >>  In other words, you can't say:
>> >>
>> >> function * ofCollection() {for (i of collection) yield i};
>> >> var itr1 = ofCollection();
>> >> var itr2 = iter1.constructor();  //TypeError
>> >>
>> >
>> > That wouldn't be a type error. It would be invoking the value of the
>> > inherited generator property.
>> >
>> 
>> Sorry, "...inherited *constructor* property" that is.
> 
> But the inherited constructor property is not callable, so it's still a 
> TypeError:

Exactly, I had assumed that was obvious from the diagram :-)

Allen
> 
>> js> function * ofCollection() {for (let i of collection) yield i};
>> js> var itr1 = ofCollection();
>> js> var itr2 = itr1.constructor();
>> uncaught exception: TypeError: object is not a function
> 
> 
> - André

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to