-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
I am being able to access private properties outside the class #7687
Comments
The image haven't been uploaded, my mistake. Is does work with "#", but it doesn't with private private handler: StringHandler | BufferHandler; constructor( |
|
TypeScript’s private doesn’t use the JavaScript feature for private fields and we cannot change this without breaking lots of code. |
You are both correct, thanks for the information. |
What version of Bun is running?
1.0.18+36c316a24
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
Example
async prepare() {
this.fileSystemHandler = new FileSystemHandler(this.finalDir);
console.log(
"file: classifier.ts:29 || this.fileSystemHandler.handler:",
this.fileSystemHandler.handler.data
);
this.fileSystemHandler.handler = {};
console.log(
"file: classifier.ts:31 || this.fileSystemHandler:",
this.fileSystemHandler.handler
);
}
Log:
file: classifier.ts:29 || this.fileSystemHandler.handler: null
file: classifier.ts:31 || this.fileSystemHandler: {}
What is the expected behavior?
Don't run
What do you see instead?
Code running and showing information it shouldn't
Additional information
I was able to get a private property to work via "#property"
The text was updated successfully, but these errors were encountered: