Closed lucacasonato closed 1 year ago
SWC fails to apply legacy TS method decorators for anonymous classes.
const foo = class { @foo foo(v){return v} }
{ "jsc": { "parser": { "syntax": "typescript", "tsx": false, "decorators": true }, "target": "es5", "loose": false, "minify": { "compress": false, "mangle": false } }, "module": { "type": "es6" }, "minify": false, "isModule": true }
https://play.swc.rs/?version=1.3.74&code=H4sIAAAAAAAAA0vOzysuUUjLz1ewVUjOSSwuVqhWcABxgVijTLO6KLWktChPoaxWoRYAm3SIQysAAAA%3D&config=H4sIAAAAAAAAA2WPQQ7DIAwE73lF5HOv7aF%2F6CMQcSIqwMh2pEZR%2Fl4CCW3VG97Bu96163t4ioV7v%2BZnHpJhQW5zVmSJal5ZAV0SimWXFC4nVdnRaLxg0wa0xEaJJSPlGQvYKgc1PKHufijXwwg8keCvEQQX3bh8n2IpJEaRv8Rg4uTbfo3rjkgINMwFHhX3GjX%2BBp9PZ1gzBiePc7OU2N6FM0VqLgEAAA%3D%3D
No response
This should not error with _class is not defined
_class is not defined
Errors with _class is not defined
1.3.74
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
SWC fails to apply legacy TS method decorators for anonymous classes.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.3.74&code=H4sIAAAAAAAAA0vOzysuUUjLz1ewVUjOSSwuVqhWcABxgVijTLO6KLWktChPoaxWoRYAm3SIQysAAAA%3D&config=H4sIAAAAAAAAA2WPQQ7DIAwE73lF5HOv7aF%2F6CMQcSIqwMh2pEZR%2Fl4CCW3VG97Bu96163t4ioV7v%2BZnHpJhQW5zVmSJal5ZAV0SimWXFC4nVdnRaLxg0wa0xEaJJSPlGQvYKgc1PKHufijXwwg8keCvEQQX3bh8n2IpJEaRv8Rg4uTbfo3rjkgINMwFHhX3GjX%2BBp9PZ1gzBiePc7OU2N6FM0VqLgEAAA%3D%3D
SWC Info output
No response
Expected behavior
This should not error with
_class is not defined
Actual behavior
Errors with
_class is not defined
Version
1.3.74
Additional context
No response