Microsoft/TypeScript
在 GitHub 查看Comments on constructor super call not preserved in ES5 unless it has additional empty line
Open
#49,045 创建于 2022年5月10日
Domain: Comment EmitExperience EnhancementHelp WantedSuggestion
仓库指标
- Star
- (48,455 star)
- PR 合并指标
- (平均合并 6天 17小时) (30 天内合并 9 个 PR)
描述
Bug Report
🔎 Search Terms
- comments
- stripped
- super
- constructor
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
⏯ Playground Link
Playground link with relevant code
💻 Code
class B {
constructor(...args: any[]) {}
}
class A extends B {
constructor(...args: any[]) {
/** this comment is not preserved */
super(...args)
}
}
class C extends B {
constructor(...args: any[]) {
/** this comment is preserved */
super(...args)
}
}
🙁 Actual behavior
Comment on the super call was not preserved in the ES5 output
🙂 Expected behavior
Comment on the super call to be preserved