Erik Arvidsson wrote:
This is why, if we ever agree on class syntax we might want to consider being
opinionated and prevent such usage.

I'll see and raise: class syntax should use a restrictive body plan that's not an object literal specifically so it can't have data properties where it has prototype methods and accessors. You might argue for an object literal with method definition shorthand and get/set accessors, and just ban data properties (p:42, e.g.) but:

1. People will expect them and we can't add them in the future without adding the footgun or diverging from object literals in how data properties bind instance properties, while methods and accessors bind prototype properties.

2. The comma separation is a pain, and unnecessary with bespoke class syntax, so usability says we should avoid it.

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

Reply via email to