Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jkieboom opened this issue May 10, 2022 · 1 comment
Labels
Domain: Comment Emit The issue relates to the emission of comments when compiling Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@jkieboom
Copy link

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

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Help Wanted You can do this Domain: Comment Emit The issue relates to the emission of comments when compiling Experience Enhancement Noncontroversial enhancements labels May 12, 2022
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone May 12, 2022
@RyanCavanaugh
Copy link
Member

Comment preservation is not guaranteed in all cases, but this behavior does seem odd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Comment Emit The issue relates to the emission of comments when compiling Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants