question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Private fields in decorated classes are not supported yet

See original GitHub issue

Are 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolo-ribaudocommented, Aug 26, 2020

Note that this plugin doesn’t reflect the current proposal anymore

0reactions
nicolo-ribaudocommented, Feb 1, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found