Skip to content

the "source" returned by "originalPositionFor" is different with "sources" of sourceMap file #267

@kiwenlau

Description

@kiwenlau

I use "originalPositionFor" to get the original position.

    console.log(JSON.stringify(sourceMap.sources, null, 4));

    var smc = new SourceMap.SourceMapConsumer(sourceMap);
    var result = smc.originalPositionFor(
    {
        line: parseInt(lineNumber),
        column: parseInt(columnNumber)
    });

    console.log(result.source);

I print out the "sources" property of sourceMap and the "source" of "originalPosition" results, but they are different, making it hard for me to locate the exact "sourcesContent" of sourceMap.

sourceMap.sources:

[
    "webpack:///static/js/manifest.b7cf97680f7a50fa150f.js",
    "webpack:///webpack/bootstrap 67e184f9679733298d44"
]

result.source:

webpack:/webpack/bootstrap 67e184f9679733298d44

result.source misses "//", which is quite strange.

Any suggestion? Thx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions