let function

Brendan Eich brendan at mozilla.org
Wed May 20 00:22:34 UTC 2015


Your point about decorators vs. hoisting is good, everyone should keep 
it in mind. Still doesn't mean we can't add a special form for const 
function, as followups aver.

/be

Alexander Jones wrote:
> On 19 May 2015 at 02:02, Brendan Eich <brendan at mozilla.org 
> <mailto:brendan at mozilla.org>> wrote:
>
>
>     This seems like a better shorthand to discuss, compared to `let
>     function` (which function-in-block covers already, as noted).
>
>
> function-in-block does not have the same semantics as the proposed 
> "let function". It hoists, thus has no TDZ, and appears to preclude a 
> reasonable decorator syntax behaviour, and it has no provisions for 
> const binding, i.e. "const function".
>
>     let f(x) => y
>
> appears attractive indeed, but by virtue of it being an arrow 
> function, has lexical this and no prototype property. Also no 
> generator syntax, unless I'm missing something?
>
> Cheers


More information about the es-discuss mailing list