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
Wrong code generation when a async class method has a decorator before a jsdoc comment. It compiles the aync keyword wrongly before the method name.
Input code
constprintMemberName=(target: any,memberName: string)=>{console.log(memberName);};classTestClass{// moving the decorator below the comment works as expected
@printMemberName/** * some tsdoc comments * * Some more comments * over * multiple * lines */asyncrun(): Promise<boolean>{returnawaitPromise.resolve(true);}}export{TestClass};
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
Wrong code generation when a async class method has a decorator before a jsdoc comment. It compiles the
aync
keyword wrongly before the method name.Input code
Config
Playground link
https://play.swc.rs/?version=1.2.157&code=H4sIAAAAAAAAA11Qy0rEQBC8B%2FIPfUyCbO7RFcGzIugPTCZNDM5Mh%2B7OxiXsvzsTk1V2DtOPKoqushREYeQh6Av6FvnVeIQjFGq4R23AhPMd%2BCvUgGgk9yUcH2HJM4jPRg1yeHDUF3%2FM8j6hl%2FjnmXVGBD5Q9HntlrRMcF2Dp1PUA%2F1E6NASGyWGFh3N686S9xgUZuIvASOA3yNaxe5X4Onm9FW0qtbDKhCKZlQ6sruObMhW3hPBE%2BMtTifkrfWT02F0uI1uCLix6lSMnIMFnkJRNvDG5AfBh5ZiICZcI2LUiQOY2Qy6kw6MMbYTFsrTnlaeXZKv6JFYYfkXWQryB8N5v3OtAQAA&config=H4sIAAAAAAAAA0WOMQ6DMAxF7%2BKZATGyVcztHSIwKDSJI9tURYi710EUNit5%2F%2F2%2FwSw9tBtkx4JcLlmTui%2B0oGtG6dlnhQoG7ImdEgu0ygtWoGLQ6ILY%2FUbMXXAiLxfxJHZDHE%2BopkJp6qY2TWa0mg8%2BQugoRkx6%2BQKR4GWMPvlxLXt6iiUl95dLU%2FiTu9VEGpbysB2Trc4ikdIssN%2BiM%2BzledLHxh%2BMYVykAAEAAA%3D%3D
Expected behavior
the
async
keyword should stay before the method nameActual behavior
The
async
keyword is compiled before the jsdoc comment.Version
1.2.165
Additional context
comments are required for istanbul coverage collector.
https://github.com/renovate-reproductions/swc-jest#swc-jest
The text was updated successfully, but these errors were encountered: