arrow function syntax simplified

Kevin Smith khs4473 at
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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list