some generator issues

Neil Mix nmix at
Mon Apr 23 08:08:26 PDT 2007

>> The unwieldy part being that you're required to set
>> arguments.generator to a local var because otherwise the arguments
>> object gets masked.  But this could be simplified a little if you
>> could obtain a send() delegate directly from the generator object:
> Wouldn't Function.prototype.bind
> ( be
> sufficient for this?

Yes, although a bit wordy as you point out.

> It's definitely wordier, but the user could also easily implement your
> delegate() method above by adding it to Function.prototype.

I don't follow -- did you mean Generator.prototype?

> Alternatively, we could make and gen.send() special in that
> they are already prebound to gen (e.g. still
> results in gen.send()). Personally, I'd rather not do this - pretty  
> much
> all builtin classes have unbound prototype methods rather than bound
> instance methods.


More information about the Es4-discuss mailing list