Skip to content

TypeScript removing comments where it shouldn't #2546

Closed
@qyoz

Description

@qyoz

comment.ts

if (false) {
    //I will be removed
}
//I will be removed
else {
    //I will not be removed
    var tmp;
    //I will be removed
}

try{
    //I will not be removed
    var tmp;
    //I will be removed
}
//I will be removed
catch(e){
    //I will not be removed
    var tmp;
    //I will be removed
}

comment.js

if (false) {
}
else {
    //I will not be removed
    var tmp;
}
try {
    //I will not be removed
    var tmp;
}
catch (e) {
    //I will not be removed
    var tmp;
}

Are there any additional flags that can be set for TS to keep all comments?

Same issue from CodePlex

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Comment EmitThe issue relates to the emission of comments when compilingFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions