Skip to content

How can I debug compilation? #3318

Closed
Closed
@urbanhop

Description

@urbanhop

This is less an issue but a request for advice. I try to change the way code for namespaces is emitted.

Currently the typescript code

namespace A{
    var x = 42;
}

is emitted as

var A;
(function (A) {
    var x = 42;
})(A || (A = {}));

which I want to change to be emitted as

    var A_x = 42;

Obviously, all references to x also need to become A_x .

I walkted through emitter.ts and declarationEmitter.ts but without being able to stepping through the compilation with a debugger it is hard to fully understand the pieces. So my question:

How can I debug compilation ?
Hints on my namespace hack are also appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions