Generator issue: exceptions while initializing arguments

Brendan Eich brendan at mozilla.org
Sat Sep 8 13:43:33 PDT 2012


Brendan Eich wrote:
>>  However, the semantics of parameter default value initialization can 
>> result in exceptions and more closely links argument instantiations 
>> with the actual activation of the generator function. You can't 
>> really build the parameter bindings without performing declaration 
>> instantiation for the function.
>
> Agreed, that's absolutely true (no "really" about it -- or rather, 
> "for real" ;-). 

And (I should have written), if your point was that we must bind all var 
and top level function/let/const declarations before the implicit yield; 
inserted "after the opening brace", I don't see a problem. Hoisted 
functions with usable initial values, hoisted vars with undefined 
initial values, and temporal dead zones for the let and const 
declarations that are at top (generator body) level. Right?

/be


More information about the es-discuss mailing list