Self-recursion and arrow functions

Rick Waldron waldron.rick at gmail.com
Sun Mar 17 19:43:28 PDT 2013


On Sun, Mar 17, 2013 at 9:50 PM, Matthew Robb <matthewwrobb at gmail.com>wrote:

> I know I am late to this party and I am not sure how serious it even is
> but can someone help me understand why function expressions require
> anything special to denote the fact that it's a function?
>
> `
> requestAnimationFrame(onFrame(time) { })
>

The parser would need to tokenize the input until it reached the "{" to
determine whether the input was an PrimaryExpression or FunctionExpression.



> `
>
> The following seems a pretty convenient side benefit:
>
 `
> let onFrame(){}
> const onFrame(){}
> var onFrame(){}
>

This has appeared before, thread starts here:
https://mail.mozilla.org/pipermail/es-discuss/2008-November/008218.html



> function onFrame(){}
>

This is a FunctionDeclaration, nothing new here.


Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130317/fc71be46/attachment.html>


More information about the es-discuss mailing list