Skip to content

fix(indexed): apply lineShift before comparing with next section offset - #562

Open
user-Param wants to merge 1 commit into
mozilla:masterfrom
user-Param:fix/542-539-indexed-lastcolumn-shift
Open

user-Param wants to merge 1 commit into
mozilla:masterfrom
user-Param:fix/542-539-indexed-lastcolumn-shift

Conversation

@user-Param

Copy link
Copy Markdown

Fixes #542 and #539.

In IndexedSourceMapConsumer.generatedPositionFor, allGeneratedPositionsFor,
and eachMapping, the section-boundary check compared the section-relative
generated line against the next section's absolute generated line offset
before applying lineShift. This meant the clamp never triggered for sections
with a nonzero line offset, leaving lastColumn as infinity.

Fixes #542 and #539.

  • Added regression tests for both issues
  • All 192 tests pass

In IndexedSourceMapConsumer.generatedPositionFor, allGeneratedPositionsFor,
and eachMapping, the section-boundary check compared the section-relative
generated line against the next section's absolute generated line offset
before applying lineShift. This meant the clamp never triggered for sections
with a nonzero line offset, leaving lastColumn as Infinity.

Fixes mozilla#542 and mozilla#539.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indexed source maps: lastColumn is not clamped to the next section when the section does not start on line 1

2 participants