-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Inheritance Issue with SWC Compilation #8577
Labels
Comments
See #7435
|
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
I am currently facing an issue while upgrading an old project to use SWC for compilation. The project consists of both JavaScript and TypeScript files, and there is a scenario where a TypeScript class (New.ts) extends a JavaScript class (Old.js). The TypeScript class includes a private property value, but during SWC compilation, this property is transformed into
_define_property._(_assert_this_initialized._(_this), "value", void 0);
, leading to value being overwritten asundefined
.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.3.107&code=H4sIAAAAAAAAAzXMQQ7CIBQE0P0%2FxbjTDUTdtfEKegak34hBauDTNmm4uy3a2c1M8rTGw3lucPOdeiWy3qS0FsyEJbYPSWK20sf94b%2BtkadLajA%2BMy44ns5tfQoVIr2RuPKoZDOXAp6EQ1f9H%2FWJbjDCqNKuQcjvO8eWyhfiG7IxmAAAAA%3D%3D&config=H4sIAAAAAAAAA22Quw6DMAxFd74Cee7apWuXLu0%2FWGBQ2rxkGwmE%2BPcmlFBUdYvvyc1RPFd1DU9p4FLP6ZiGiCzE%2B5wSmbzimBLQKZI0bKLCqVCVjDq0Qmu0fAgock%2BaWyTn7TrQqMQe7Y1sJJZElQfaoDPedNPR3AQXmUSKYJc69L2lv94XUbxaFHmgox%2BDDUGOrbXz9e4OMHIP7bAaSh1cSbZF5WXk7w2uhfxWtbwBcTGuOk0BAAA%3D
SWC Info output
No response
Expected behavior
We expect that when inheriting properties from a parent class, the initialization and access of those properties should remain intact during SWC compilation.
Actual behavior
No response
Version
1.3.107
Additional context
No response
The text was updated successfully, but these errors were encountered: