-
-
Notifications
You must be signed in to change notification settings - Fork 258
Class Fields (combined) - Stage 2 #540
Comments
Since the code for classBody is a bit messy, as part of the "unification" I want to clean all that up. Moreover, for internal renaming I would love to have feedback on the following (mostly implementation details):
@hzoo Will try to work on all of this over the weekend. function privateStatePlugin () {
return {
visitor: {
Program() {
},
ClassPrivateProperty(path) {
// We want to rename this one
},
PrivateName(path) {
// IMHO most of the times, you want to skip here
// path.node.name == Identifier
// otherwise you will get the Identifier several times, sometimes unexpectedly
path.skip();
},
Identifier(path) {
//console.log('\n>>>>> ID ', path.node); // Nothing new here.
}
},
};
} |
Note that Waldemar Horwat pointed out an ambiguity in the grammar, that because we can have static fields named |
@littledan not sure I'm following, what is likely to change? |
Well, I'm not sure exactly, I have sent an email to Waldemar to clarify. Now that I look at it some more, I'm not sure what the ambiguity is. |
I heard back from Waldemar; it seems the issue was just a typo in the proposal, where it rendered wrong. But declarations end in a semicolon (and ASI fixes it). This was a recently introduced error in the spec formatting, so no need to hold anything up! |
tc39/proposal-class-public-fields#63 @littledan Is this the answer to above question? and what about props and methods named like |
I will try to give it a run over the weekend. |
@bounceme |
@diervo Still catching up on things, but for your comment about |
@diervo To add to @loganfsmyth's comment, you still have to be aware of context even now, because of existing |
- Fixes babel#540 - Fixes location for publicFields (should not contain semi-colon) - Added tests
- Fixes babel#540 - Fixes location for publicFields (should not contain semi-colon) - Allow decorators for comma separated fields - Added tests
- Fixes babel#540 - Fixes location for publicFields (should not contain semi-colon) - Allow decorators for comma separated fields - Added tests
- Fixes babel#540 - Allow decorators for comma separated fields - Added tests
This issue has been moved to babel/babel#6692. |
Champions: @jeffmo (public class fields) @littledan (private + combined)
Spec Repo: https://github.com/littledan/proposal-class-fields/
Spec Text: https://littledan.github.io/proposal-class-fields/
Slides: https://drive.google.com/file/d/0B-TAClBGyqSxWHpyYmg2UnRHc28/view
Examples
Parsing/ESTree
classProperties
andclassPrivateProperties
.Transform
Contacts
The text was updated successfully, but these errors were encountered: