Microsoft/TypeScript

Comments on constructor super call not preserved in ES5 unless it has additional empty line

オープン

#49,045 opened on 2022/05/10

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
Domain: Comment EmitExperience EnhancementHelp WantedSuggestion

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド