Skip to content

Incorrect interpretation of mappings that only have a minified column #105

@loewenheim

Description

@loewenheim

A mapping in a sourcemap can contain 1, 4, or 5 data points. The first is always the minified column number, the next 3 (if present) are the original file, line, and column, and the last (if present) is a name.

The obvious implication is that a mapping with only 1 data point should not have an original line or column number (if it did, it should tell us the file).

However, in such cases we currently simply carry over the last set line and column number unchanged. We do handle the src_id and name correctly by setting them to u32::MAX if they are missing, see

let mut src = !0;
let mut name = !0;

ETA: See also Note 2 under https://tc39.es/ecma426/#sec-mappings.

Segments with one field are intended to represent generated code that is unmapped because there is no corresponding original source code, such as code that is generated by a compiler.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions