Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat generated column number as 0-based in indexed originalPositionFor #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

motiz88
Copy link

@motiz88 motiz88 commented Mar 19, 2019

Currently originalPositionFor behaves differently in BasicSourceMapConsumer and IndexedSourceMapConsumer:

  • In the former, the column argument is (correctly and as documented) treated as 0-based.
  • In the latter, the column argument is treated as 1-based for the purpose of locating the section in which the generated position occurs (as the internal section.generatedOffset.generatedColumn field is, for whatever reason, 1-based).

This is a longstanding issue, going back to the introduction of IndexedSourceMapConsumer AFAICT, but the behavior is incorrect. This PR fixes the issue and adds a corresponding test.

@coveralls
Copy link

coveralls commented Mar 19, 2019

Pull Request Test Coverage Report for Build 547

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.385%

Totals Coverage Status
Change from base Build 546: 0.0%
Covered Lines: 824
Relevant Lines: 911

💛 - Coveralls

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.

None yet

2 participants