-
-
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
addInitializer missing on class field decorators #8525
Comments
This was referenced Feb 5, 2024
This is what's causing the issue right here: swc/packages/helpers/esm/_apply_decs_2203_r.js Lines 54 to 56 in 89bd0c8
|
kdy1
pushed a commit
that referenced
this issue
Feb 14, 2024
**Description:** At some point the spec text of ES decorators was changed to also have addInitializer for field decorators. This is already used e.g. in mobx. This simple change removes the special case that was present for field decorators and seems to fix the issue for me. This change is backwards compatible since it only affects code that was broken before. **Related issue:** - Closes #8525
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
outputs undefined
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.3.100&code=H4sIAAAAAAAAAyWNwQrCMBAF7%2FsVj55SkILnIngS%2FApJk60uhF1oEiwV%2F920nmeYmauGIqaY%2FOIeJ4Sy9vgQEEyzJR6SPV2XX1ZThFrBxKgaeRbl2B3%2B4GO8qxTxSTZe%2Fo2RvhSSzxk3syN4bYd22XDBuUEi5fcOXU8%2FkPoNpIUAAAA%3D&config=H4sIAAAAAAAAAz2MwQqEMAxE7%2F2KkLOCdG%2F7Id5LjeDCtmWShRXpvxsRvL1h5s0RiPijmd90OHpoCSq4MrHuxdLfmW1vohlbMx6IF8kVySrUO8NPqA%2B3bUhF14rvffAMZ4FutVxXcYpxnF5M3ZUeejgB%2BD%2B8W4QAAAA%3D
SWC Info output
No response
Expected behavior
addInitializer should be defined on class property decorators as well as .
The same code works on babel and tsc. I thought it was an issue there since the proposal readme says addInitializer does not exist, but apparently the readme is outdated against the actual spec.
Actual behavior
No response
Version
1.3.104
Additional context
https://arai-a.github.io/ecma262-compare/?pr=2417
microsoft/TypeScript#57096
causes mobx to not work with swc: mobxjs/mobx#3817
The text was updated successfully, but these errors were encountered: