Skip to content

Support private properties syntax #2896

Open
@lloydjatkinson

Description

@lloydjatkinson

Feature suggestion

Support private properties: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties

Example:

class Class {
    #example: i32;
}

Activity

mattjohnsonpint

mattjohnsonpint commented on Mar 25, 2025

@mattjohnsonpint
Contributor

Is this just a request to support the # syntax instead of private? Or would you expect a difference in functionality?

Considering the feature overview from the TypeScript 3.8 release notes (when it was added), in TypeScript private is "soft privacy" where # is "hard privacy". But in AssemblyScript, since there's no JS transpile, then I believe private is already "hard privacy".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mattjohnsonpint@lloydjatkinson

        Issue actions

          Support private properties syntax · Issue #2896 · AssemblyScript/assemblyscript