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
I'm writing tests for the JavaScript decorators proposal as part of esbuild's implementation: https://github.com/evanw/decorator-tests. This issue is mainly to let you know about the tests, which you may find useful. There are over 200 test failures so I'm not going to list them all out here. In certain cases, SWC generates code with syntax errors when transforming code containing JavaScript decorators. These syntax error bugs are reported below. There are also many behavioral bugs that are not reported here but that can be found in the test suite.
Input code
// SWC turns this into code with a syntax errorclassFoo{
accessor foo;staticaccessorfoo;}// SWC turns this into code with a syntax error
@decclassBarextends(awaitBar){
@decstaticfield;}// SWC fails to transform this decorator at allclassBaz{
accessor foo= @decclass{}}
Describe the bug
I'm writing tests for the JavaScript decorators proposal as part of esbuild's implementation: https://github.com/evanw/decorator-tests. This issue is mainly to let you know about the tests, which you may find useful. There are over 200 test failures so I'm not going to list them all out here. In certain cases, SWC generates code with syntax errors when transforming code containing JavaScript decorators. These syntax error bugs are reported below. There are also many behavioral bugs that are not reported here but that can be found in the test suite.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.5.4&code=H4sIAAAAAAAAA5WPTQrCQAxG93OKb6mrHkAEUfACLlyH6ZQOjBNIIq2W3t2xrVDEjVl%2B%2BXkvVYXL9QS7S1ZYGxUxG8NzHdBFa0HQRzbqEURYnE%2BkijMzBodS5H1QZUHDvJsSNbLovxqjc9WfpEMdPGbckQSht5BrxYY6ivaOtovCNLhQmxhSvcY1FFPBMUwoa8Nym9llh4Ws%2BJGBUnIf0vPHY9hjZTOM5f4LT6dv4DgBAAA%3D&config=H4sIAAAAAAAAA02OsQrDMAxE93yF0ZxCcLd8SHfhqiGF2uakQkPIv1duQuggkO7eHVq7EOipicaw%2BuqHMSYxv0k0DjFSv%2BuVoYKTc0WXbPxppC1VNGGudtDu3iUVsBWoE4a3%2FIztaDNw1kfB67%2FwjNwEOpfcqtsLl%2BFKe7prs30BOXCfLbUAAAA%3D
SWC Info output
No response
Expected behavior
When given valid JavaScript code as input, SWC should never generate code containing syntax errors.
Actual behavior
No response
Version
1.5.4 (the latest on the playground)
Additional context
No response
The text was updated successfully, but these errors were encountered: