>>/ 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:
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