-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Gh 41788 incorrect output for esprivate with nested class in esnext #42663
Gh 41788 incorrect output for esprivate with nested class in esnext #42663
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.
I think it's missing a check that the property is static.
@sandersn Thank you for the review. I fixed the issues. Let me know if there are any others changes I should make. |
@dragomirtitian Sorry for the delay on this. I tried merging from master but there are some changes in the emit that were so complex that I couldn't tell whether they were correct. Can you take a look? I'll merge after that. |
… if target:ESNext and useDefineForClassFields:false.
…true for target esnext
…ode review issues.
90e6067
to
dc0a347
Compare
This also fixed #34787 |
Since TypeScript 4.3, `target: "esnext"` indicates that `useDefineForClassFields: true` as the new default. See <microsoft/TypeScript#42663> So I'm explicitly adding this field to the tsconfigs to avoid any confusions. Note that `lit-element` projects must use `useDefineForClassFields: false` because of <https://github.com/lit/lit-element/issues/1030> Vue projects must use `useDefineForClassFields: true` so as to support class style `prop` definition in `vue-class-component`: <vuejs/vue-class-component#465> Popular React state management library MobX requires it to be `true`: <https://mobx.js.org/installation.html#use-spec-compliant-transpilation-for-class-properties> Other frameworks seem to have no particular opinion on this. So I turned it on in all templates except for the `lit-element` one.
Fixes #41788
Fixed as described in comment