As a supporter of no-semi style, would you be in favor of mandatory semicolons for class fields?
-
-
Replying to @wycats @lucasazzola and
As a supporter I don't personally mind the new ASI hazards. The bad ones. The worst one is `async`, so if I could get one wish, it would be to get rid of that.
2 replies 0 retweets 0 likes -
-
Replying to @wycats @lucasazzola and
If possible, I would special-case the async "field name" in class bodies, make it not trigger ASI. (make it behave just like `get`)
1 reply 0 retweets 0 likes -
Replying to @spion @lucasazzola and
Outside of classes, async is already a variable, so it requires a NoLineTerminatorHere. You're saying in classes relax that restriction so that you would *require* a semi for a field named get, set or async?
1 reply 0 retweets 0 likes -
Replying to @wycats @lucasazzola and
I thought fields named `get` and `set` already require a semicolon? I thought `async` should be included too. https://tc39.github.io/proposal-class-fields/#sec-asi-hazards-in-class-bodies …
1 reply 0 retweets 0 likes -
Replying to @spion @lucasazzola and
Sorry. (this space is confusing with all the double negatives inside of double negatives). We could relax NoLineTerminatorHere for async methods in classes, but we won't be able to do that again for new contextual keywords later. Also inconsistency with async functions.
2 replies 0 retweets 0 likes -
Replying to @wycats @lucasazzola and
Consistency is impossible, but I see your other point. What if additionally semicolons are required for fields without an initializer?
1 reply 0 retweets 0 likes -
Replying to @spion @lucasazzola and
Would that be acceptable to people who want a no-semi style?
2 replies 0 retweets 0 likes -
Replying to @wycats @lucasazzola and
Can't speak for everyone, but it would be to me. (But to be honest, without decorators I don't see why I would define uninitialised fields anyway)
1 reply 0 retweets 0 likes
Yehuda Katz 🥨 Retweeted Yehuda Katz 🥨
Yehuda Katz 🥨 added,
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.