Skip to content

Some comments get stripped out of JS output #5848

Closed
@alvarorahul

Description

@alvarorahul

The following TS file

export = Main;
module Main {
    // Test 1

    class Foo {
        // Test 2
        public bar = 5;
        // Test 3
        }

    // Test 4
}

produces the following JS output

define(["require", "exports"], function (require, exports) {
    var Main;
    (function (Main) {
        // Test 1
        var Foo = (function () {
            function Foo() {
                // Test 2
                this.bar = 5;
            }
            return Foo;
        })();
    })(Main || (Main = {}));
    return Main;
});

NOTE that the comments // Test 3 and // Test 4 are not present

I would expect that all comments in the TS file are preserved in the generated JS file

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions