arrow function syntax simplified

Rick Waldron waldron.rick at gmail.com
Tue Mar 27 18:43:46 PDT 2012


On Tue, Mar 27, 2012 at 7:46 PM, Luke Hoban <lukeh at microsoft.com> wrote:

> > >Luke Hoban wrote:
> > > The do expressions serve a separate purpose of changing the meaning of
> return (but not break and continue)
> > Dave proposed at
> > https://mail.mozilla.org/pipermail/es-discuss/2012-March/021000.html
> > that do expressions be fully TCP compliant. No way to be half-pregnant
> :-/.
>
> True - I misspoke there.  The concern related to break and continue I had
> in mind was separate from what I noted - it is the issues raised at
> https://mail.mozilla.org/pipermail/es-discuss/2012-January/019525.html.
>
> But my primary point was just that in Rick's examples, there doesn't
> appear to be any reliance on TCP at all.  Had => supported blocks on the
> RHS as in the original arrow proposal, all the code samples would be
> simpler, simply removing the 'do'.  I believe this will generally be true
> too.
>

All of the cases that use () => do { } are doing so where they require
multiple statement expressions that inherit lexical |this|.

Unless I've missed something, the examples are correct.

IINM, these meet the TCP use case:


https://github.com/rwldrn/popcorn-js/blob/481338a3ab05ad3423c67b70df690bf19977f9bc/popcorn.js#L15
https://github.com/rwldrn/popcorn-js/blob/481338a3ab05ad3423c67b70df690bf19977f9bc/popcorn.js#L282
https://github.com/rwldrn/popcorn-js/blob/481338a3ab05ad3423c67b70df690bf19977f9bc/popcorn.js#L481
https://github.com/rwldrn/popcorn-js/blob/481338a3ab05ad3423c67b70df690bf19977f9bc/popcorn.js#L487


Rick


>
> Luke
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120327/39bef27d/attachment.html>


More information about the es-discuss mailing list