Private fields in decorated classes are not supported yet
See original GitHub issueAre there plans to support private fields in decorated classes? (or is there a plugin for this). I can’t seem to find much info on the issue:
SyntaxError: /Users/paulnewell/Development/my-app/src/components/my-app.js: Private fields in decorated classes are not supported yet.
33 | @property({type: String}) appTitle = '';
34 |
> 35 | @property({type: String}) #page = '';
| ^
36 |
37 | @property({type: Boolean}) #snackbarOpened = false;
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Decorators and Private fields javascript - Stack Overflow
Private fields in JS are completely private and inaccessible to anything from outside. Thus it makes sense they cannot be decorated - there ......
Read more >7.2.0 Released: Private Instance Methods - Babel.js
This release includes support for private instance methods and a bunch of bug fixes regarding Flow and TypeScript types.
Read more >JavaScript metaprogramming with the 2022-03 decorators API
“Compatible” means that the returned value must have the same type as the decorated value – e.g., class decorators must return callable values....
Read more >Defining Entities - MikroORM
Entities can be defined in two ways: Decorated classes - the attributes of the entity, as well as each property are provided via...
Read more >Classes and methods - Finance & Operations | Dynamics 365
You can modify an instance field declaration by using the private, protected, or public keywords. Note. Making a member field public may not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Note that this plugin doesn’t reflect the current proposal anymore
I’m closing this PR, since the current non-legacy decorators implementation will be removed in Babel 8 because it’s completely different from the current decorators proposal.