Shorter syntax for arrow function assignment

Isiah Meadows isiahmeadows at gmail.com
Wed Oct 25 11:43:48 UTC 2017


I 100% agree it's a terrible idea, and this proposal's syntax sucks for
this very reason.

I'll note a few things:

1. The main proposal AFAICT is for `let foo() {}`, not `foo() {}`.
2. It does *not* syntactically conflict with object methods, because it's
only valid as a statement.
3. It conflicts with existing ASI, but only with `let` and `var`, where
this is currently unambiguously valid (it's open real estate with `const`):

```js
let
foo
(
x
)
{
}

// Parsed in both sloppy and strict as:
let foo;
(x);
{}
```

On Tue, Oct 24, 2017, 16:09 dante federici <c.dante.federici at gmail.com>
wrote:

> The use case fading away doesn't mean you can drop support for it, or that
> it won't still be in use.
>
> Please stop trying to push your "shorthand" syntax of:
> ```
> myFn() {
> }
> ```
>
> It's already been pointed out in multiple cases that:
> 1. The current usages are not "outmoded"
> 2. The proposed syntax has misleading `this` binding without the arrow
> 3. Blocks, ASI, and the object shorthand notation either conflict or make
> it vague how to interpret
>
> This isn't a beneficial syntax moving forward, and it doesn't seem to add
> anything other than "I don't like typing '='".
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171025/b9425076/attachment.html>


More information about the es-discuss mailing list