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
feat(es/compat): Readonly and writeonly private field #6182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test case for the writing to a private method?
class Foo {
#method() {
}
test() {
// methods are always read-only.
this.#method = 1;
}
}
crates/swc_ecma_transforms_compat/src/es2022/class_properties/private_field.rs
Outdated
Show resolved
Hide resolved
I prefer not to, as there's already tsc test privateNameReadonly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't realize privateNameReadonly.1.normal.js
was testing a private method. There doesn't seem to be a source file in our repo?
@jridgewell It's in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swc-bump:
- swc_ecma_transforms_compat
Head branch was pushed to by a user without write access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated review comment generated by auto-rebase script
Description:
This is the most useless feature I've ever wrote.
BREAKING CHANGE:
Related issue (if exists):
closes #5599