Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript: unsupported class properties #1238

Closed
Kronuz opened this issue Oct 17, 2017 · 2 comments · Fixed by #1292
Closed

JavaScript: unsupported class properties #1238

Kronuz opened this issue Oct 17, 2017 · 2 comments · Fixed by #1292

Comments

@Kronuz
Copy link

Kronuz commented Oct 17, 2017

Support class properties.

class Foo {
  static fooProp = {};

  // scope here no longer has meta.class.js mets.block.js
  fooMethod() {
  }
}
@Thom1729
Copy link
Collaborator

This should be added on top of #1009. (I know, I say that about everything.)

The class fields proposal is in Stage 3, meaning that it's not finalized yet, but it's probably stable enough to implement as long as there's no philosophical objection to adding features that are on the standards track but are technically unfinished. The risk is that a change in the feature would impel a breaking change in the syntax. In practice, lots of developers are already using class properties using Babel, so there's good reason to implement them now despite that risk.

Now, the proposal specifies both public and private fields. Private fields are not yet implemented in Babel (or anywhere else). In addition, the risk of a spec change is probably greater. It may or may not be worthwhile to add support for private fields at this time.

@Kronuz
Copy link
Author

Kronuz commented Oct 17, 2017

Yes, those are not Stage 4 yet, but very used... as well as many Stage 2 and 1 things. I suppose, since this is for highlighting, we should support as much as possible as long as it’s commonly implemented, so “it just works” when someone tries/uses something. Other proposals not yet implemented I think should not land here yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants