Uniform block scoping

Brendan Eich brendan at mozilla.org
Wed Jul 30 15:05:05 PDT 2014


Andreas Rossberg wrote:
> I think this subtle discrepancy is both unfortunate and unnecessary
> [1]. Moreover, with ES7 do expressions, I would like it to hold that
>
>    (...) =>  {...}    ≡    (...) =>  do {...}

I channeled you as best I could, and Dmitry Lomov kindly channeled you 
on this point, but more than a few TC39ers objected that the left arrow 
function, with a body block instead of a body expression, has different 
semantics already, ignoring whether let x; in the body block could 
shadow a parameter x. First, 'return' is the only way to return a result 
in the left example, whereas thanks to do-expression being an 
expression, the completion value (reformed) of the right ... is the 
return value, even without 'return'.

I wanted to pass this back ASAP. More is being recorded in the meeting 
notes, but here you go. We'll keep channeling you as best we can!

/be


More information about the es-discuss mailing list