-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add parse support for the "structs" proposal (only non-shared) #17624
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
base: main
Are you sure you want to change the base?
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60657 |
|
commit: |
7ecda07 to
7f6e64d
Compare
7f6e64d to
c377764
Compare
c377764 to
41753c2
Compare
| @@ -0,0 +1,4 @@ | |||
| @f | |||
| struct S {} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with disallowing this but allowing accessors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, and the member decorators are not allowed as well.
IMO accessors are essentially syntax sugar serving for the purpose of decorating otherwise accessor pairs once. They can be decoupled from decorators so I see no reason to ban them in non-shared structs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :)
This PR adds support of the non-shared structs with the following AST design:
The member within the struct body is still class members. I have not yet decided whether we should leave it as-is or rename them from
Class*toStruct*.