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.

Add support for `#x in obj` private-in syntax

See original GitHub issue

The version of ESLint you are using.

7.31.0

The problem you want to solve.

Support Ergonomic brand checks for Private Fields (#x in obj syntax) officially, as it has reached stage-4. refs: https://github.com/tc39/proposals/blob/master/finished-proposals.md https://github.com/tc39/proposal-private-fields-in-in

Your take on the correct solution to problem.

Are you willing to submit a pull request to implement this change?

It’s difficult for me to change the parser. I may be able to do other necessary work.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
nzakascommented, Sep 15, 2021

Open source doesn’t follow predictable schedules. 😃

2reactions
mdjermanoviccommented, Sep 13, 2021

With #x in obj syntax, #x can appear in expressions without preceding ., and it generally can be adjacent to other tokens on its left side, so this might be seen as a false negative:

/* eslint space-unary-ops: ["error", { "words": false }] */

class C {
    #x;
    *foo(bar) {
        yield #x in bar;
    }
}

These are very edge cases, though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Private class features - JavaScript - MDN Web Docs - Mozilla
Class fields are public by default, but private class members can be created by using a hash # prefix. The privacy encapsulation of...
Read more >
oop - JavaScript private methods
After this is executed any object created with new Foo() is going to have an eval method which can be called to return...
Read more >
9. Classes — Python 3.11.1 documentation
Class objects support two kinds of operations: attribute references and instantiation. Attribute references use the standard syntax used for all attribute ...
Read more >
Object expressions and declarations
class C { private fun getObject() = object { val x: String = "x" } fun ... In all these cases, members added...
Read more >
Using the this Keyword (The Java™ Tutorials > Learning ...
Each argument to the constructor shadows one of the object's fields — inside the constructor x is a local copy of the constructor's...
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