You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_key is undefined, so the property does not define. Compiled result:
...
const sym = Symbol("sym");
var _key;
class Cls {
[_key]() {}
}
_key = sym; // <--- This must be BEFORE the class definition
__decorate([
Memoize()
], Cls.prototype, _key, null);
Version
1.2.212
Additional context
No response
The text was updated successfully, but these errors were encountered:
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.
Describe the bug
When using a @decorator for a symbol property, the compiler generates a wrong output.
Input code
Config
Playground link
https://play.swc.rs/?version=1.2.212&code=H4sIAAAAAAAAA0vOzysuUSiuzFWwVQiuzE3Kz9FQAvKUNK25uJJzEouLFZxzihWquRQUHHxTc%2FMzq1I1NIGcaKCaWA1NheparloAlz70DEMAAAA%3D&config=H4sIAAAAAAAAAxWMQQrAIAwE%2F7JnD8WjvxENpaU2kkSoiH%2Bv3padnR24NSEM1ChKspP21%2BKHAOuVNMlVDQ6ZEks0FkUwaTQdLMpJtoak%2FvAHVlU4t4f2y5YXSlwKv7dizh8GxEdwawAAAA%3D%3D
Expected behavior
It should define _key before defining the class.
Actual behavior
_key is undefined, so the property does not define. Compiled result:
Version
1.2.212
Additional context
No response
The text was updated successfully, but these errors were encountered: