Comma-separated instance field definitions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Comma-separated instance field definitions

T.J. Crowder-2
TL;DR: Comma separated instance field definitions: In or out? (Currently out, but is that decided or still up in the air?)

Verbose: In the short "Changes vs previous proposals" list at the end of the [class fields proposal][1], it says:

> Comma-separated multiple definitions: These are visible in the
> above example of class C, and are analogous to comma-separated
> definitions from var, let and const. They may be immediately
> useful when declaring multiple static fields, but later are
> useful in conjuction with decorators.

The `C` example above it doesn't have any comma-separated definitions, though; it looks like they were removed in Nov 2017 by [this commit][2].

The spec text matches with the edit (no comma-separating), and Node.js v10 with `--harmony-class-fields` and Babel both also align with that.

So all that suggests there won't be comma-separation for instance fields, am I getting that right? Or is there something in the works? (I don't see any benefit to comma separation for instance fields other than if the static fields proposal allowed them [to avoid repeating `static`], which it doesn't at the moment AFAIKS, it would make sense for the syntaxes to align, I'm just curious where the syntax is headed.)

-- T.J. Crowder




_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss