arrow function syntax simplified

Kevin Smith khs4473 at gmail.com
Wed Mar 28 09:44:22 PDT 2012


>
> we need either fat arrow or block lambda based TCP preserving functions.
>  We don't need thin arrow and we really don't need the confusion it would
> create.
>

What about situations where the user wants bound |this|, but no other TCP
stuff?  Callbacks and a large portion of event handlers fall into this
category.  Without supporting syntax, these use cases will either have to:

1) Use "=> do {}", which is heavier, and which will cause unintended
problems (completion leak and invalid use of return).

2) Use "(function() {}).bind(this)" which is awkward.

3) Use "var self = this; function() {}" which is also awkward.


kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120328/a92ef510/attachment.html>


More information about the es-discuss mailing list