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.

Support optional private prop?

See original GitHub issue
class A{a(){obj?.#x.a}}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
3cpcommented, Oct 29, 2020

In short, there were lots of arguments like ours. But it’s in the proposal now.

1reaction
3cpcommented, Oct 29, 2020

Private class fields and methods

Issue #28: Should optional chains support the upcoming private class fields and private methods, as in a?.#b, a?.#b() or a?.b.#c? Quoting microsoft/TypeScript#30167 (comment):

This one isn’t baked into the proposal yet, simply because private fields themselves aren’t baked yet. So we don’t want to hold up this proposal if that one happens to stall out. Once that one has reached Stage 4, we will address it then.

https://github.com/tc39/proposal-optional-chaining/issues/28 https://github.com/tc39/proposal-class-fields/pull/301 https://github.com/tc39/proposal-class-fields/pull/302

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Deal with Optional Things and "Undefined" in TypeScript
First, if you don't tell TypeScript that a property is optional, it will expect it to be set. Adding ? to the property...
Read more >
Optional property class in typescript - Stack Overflow
Optional property : In Typescript you can declare a property in your interface which will be optional. Suppose you have a interface for ......
Read more >
Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
The optional chaining ( ?. ) operator accesses an object's property or calls a function. If the object accessed or function called is ......
Read more >
Add Support for Optional Bean Properties · Issue #399 - GitHub
Currently, a config bean cannot define a property which is optional, in the sense that it need not necessarily have a value.
Read more >
Optional Chaining: The ?. Operator in TypeScript
We can use optional chaining to descend into an object whose properties potentially hold the values null or undefined without writing any null ......
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