Skip to content

Incorrect sourcemap for comments in module function #1980

@NN---

Description

@NN---

This works correctly, you cannot put a breakpoint on the comment:

function P() {
    // Test this
    var a = 1;
}

This is the sourcemap:

{"version":3,"file":"W.js","sourceRoot":"","sources":["W.ts"],"names":["P"],"mappings":"AAAA,SAAS,CAAC;IAETA,AADAA,YAAYA;QACRA,CAACA,GAAGA,CAACA,CAACA;AACXA,CAACA"}

While here you can put a breakpoint on the comment but cannot put on 'var a = 1' !

module Q {
    function P() {
        // Test this
        var a = 1;
    }
}

Sourcemap:

{"version":3,"file":"W.js","sourceRoot":"","sources":["W.ts"],"names":["Q","Q.P"],"mappings":"AAAA,IAAO,CAAC,CAKP;AALD,WAAO,CAAC,EAAC,CAAC;IACTA,SAASA,CAACA;QAETC,AADAA,YAAYA;YACRA,CAACA,GAAGA,CAACA,CAACA;IACXA,CAACA;AACFD,CAACA,EALM,CAAC,KAAD,CAAC,QAKP"}

Checked in Google Chrome.

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions