Rick Waldron (2014-08-25T03:31:39.000Z)
On Sun, Aug 24, 2014 at 9:52 PM, Mark Everitt <mark.s.everitt at gmail.com>
wrote:

> Today I encountered an inconsistency between SpiderMonkey and V8 (in
> Aurora 33.0a2 (2014-08-24) and Canary 39.0.2135.0 canary (64-bit)). In
> chrome, I can bind an arrow function, and in firefox I cannot (see this
> gist: https://gist.github.com/qubyte/43e0093274e793cc82ba)
>
> I find reading the ES6 draft spec hard going, but from searching around I
> get the impression that it states that bind should not be successful on an
> arrow function. If this is the case, then it raises an issue. There seems
> to be no clean way to tell apart regular functions and arrow functions (the
> only way I can do this is by looking at the result of toString). That being
> the case, arrow functions mean that we can no longer trust call, apply and
> bind, since we cannot easily tell if the function we want to bind is an
> arrow function and will silently ignore us.
>
> Having said all that, if I have the wrong end of the stick and this is a
> bug in SpiderMonkey, please let me know!
>

SpiderMonkey is correct. Arrow functions aren't meant to be a drop in
replacement for all functions. I replied to that bug confirming that Canary
is incorrect with relevant spec notes.


Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140824/b00f759d/attachment-0001.html>
domenic at domenicdenicola.com (2014-08-26T18:31:58.584Z)
SpiderMonkey is correct. Arrow functions aren't meant to be a drop in
replacement for all functions. I replied to that bug confirming that Canary
is incorrect with relevant spec notes.