On Wed, Oct 25, 2017 at 4:57 AM, T.J. Crowder <
tj.crow...@farsightsoftware.com> wrote:

> On Tue, Oct 24, 2017 at 6:26 PM, dante federici
> <c.dante.feder...@gmail.com> wrote:
> >
> > So, something like:
> > ```
> > myFn() {
> > }
> > ```
> >
> > Would be considered as:
> > ```
> > var myFn = function() {
> > }
> > ```
> >
> > with what semantics exist now. Not best practices, but what is
> > currently interpreted in the language.
>
> No, it isn't. It's a `SyntaxError: Unexpected token {`. There's a big
> difference between `myFn() { }` and `myFn = function() { };` The latter is
> valid syntax for the horror of implicit globals (in loose mode; strict mode
> fixed it). The former is just a syntax error. (It would be valid method
> syntax if it were inside an object initializer or `class`.)
>

ya this is not a syntax error.
myFn()
{
}


> But AFAIK, Brian Blakely wasn't promoting that syntax anyway. His original
> post only ever uses this shorthand with `export`, so I think it was meant
> to be specific to exporting.
>
> -- T.J. Crowder
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to