Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support private properties syntax #2896

Open
lloydjatkinson opened this issue Jan 19, 2025 · 1 comment
Open

Support private properties syntax #2896

lloydjatkinson opened this issue Jan 19, 2025 · 1 comment

Comments

@lloydjatkinson
Copy link

Feature suggestion

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

Example:

class Class {
    #example: i32;
}
@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Mar 25, 2025

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
Projects
None yet
Development

No branches or pull requests

2 participants