Arrow binding

Kevin Smith khs4473 at gmail.com
Mon Apr 23 07:30:19 PDT 2012


>
> Yeah, I think you're missing the composition arguments. If I create
> mixins with methods, they're going to have a promiscuious "this" as a
> *feature*. You might not write code like this today, but you probably
> should ;-)
>

But anyone who understands the language would not use arrow functions for
that use case.  I assume you're referring to something like this (Angus
posted a similar example a while back):

    function mixin() {
        this.{
            addMethodA() {},
            addMethodB() {}
        };
    }

Your idea of a "preferred" binding for methods is interesting (as a form of
method extraction), but I don't think it can be applied to arrow functions.

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


More information about the es-discuss mailing list