Why is .bind so slow?

Mark S. Miller erights at google.com
Sat Jul 13 12:39:09 PDT 2013


Arrow functions, whether strict or non-strict, are not supposed to have
their own |arguments|


On Sat, Jul 13, 2013 at 11:55 AM, Jeff Walden <jwalden+es at mit.edu> wrote:

> On 07/12/2013 04:59 PM, Andrea Giammarchi wrote:
> > one more thing ... I believe this will impact arrow function too since
> is basically bound callbacks all over the place (or at least this is how I
> believe it will be transpiled)
>
> Sadly, based on the arrow-function patches I've reviewed in SpiderMonkey,
> I don't believe this will be necessarily true.  Arrow functions and
> bind-bound functions are two rather different beasts.  Bind-bound functions
> are potentially constructible; arrow functions never are.
>  |arguments.callee| inside a function that's been bound doesn't refer to
> the bound function -- it refers to the lexical entity.  (That is, |function
> f() { return arguments.callee; } f.bind(null)()| is |f|, not |b|.)
> |arguments.callee| inside an arrow function -- at least, so long as arrow
> functions aren't automatically strict, which decision I would revisit --
> refers to the arrow function.  I expect there are other differences I'm not
> yet aware of, that would affect having a common implementation of the two
> concepts.
>
> It seems like a pretty bad idea to me for arrow functions to not be
> substantially semantically similar to bind-bound functions, but they are as
> it stands now.  I wish I had the time to sit down and think through a solid
> unification of the two concepts.
>
> Jeff
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130713/c220b317/attachment.html>


More information about the es-discuss mailing list