Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

What about protected fields? #86

@trusktr

Description

@trusktr

The majority of the time, when I write something like this._foo = 'bar', it ends up being a "protected" member when subclasses refer to the property yet I don't want the property to be part of the public API. A good chunk of the time the properties remain "private".

It would be great if this proposal would have all three of public, protected, and private fields.

Here's an class utility I made with public, protected, and private members, including a super helper for super public or protected methods (I can support super for private methods too, but I wasn't sure yet if that makes sense): https://github.com/trusktr/lowclass.

I'm thinking it would interesting to make a Babel plugin that can convert syntax from this proposal into something that uses lowclass at runtime, for proof of concept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions