Skip to content

Fix an off-by-1 error in section lookup - #507

Merged
bomsy merged 1 commit into
mozilla:masterfrom
takikawa:fix-section-lookup-off-by-one
May 30, 2024
Merged

Fix an off-by-1 error in section lookup#507
bomsy merged 1 commit into
mozilla:masterfrom
takikawa:fix-section-lookup-off-by-one

Conversation

@takikawa

Copy link
Copy Markdown
Contributor

This should fix issue #506.

@takikawa
takikawaforce-pushed the fix-section-lookup-off-by-one branch 2 times, most recently from 27daf1a to 86db47bCompareMay 7, 2024 22:10
@takikawatakikawa mentioned this pull request May 9, 2024
Comment threadlib/source-map-consumer.js Outdated
Comment threadlib/source-map-consumer.js Outdated

@bomsybomsy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this patch. Apologies for the delay in reviews. It looks great! I've got a few review comments.

@takikawa
takikawaforce-pushed the fix-section-lookup-off-by-one branch from 86db47b to 3789341CompareMay 28, 2024 17:07
@takikawa

Copy link
Copy Markdown
ContributorAuthor

Thanks for this patch. Apologies for the delay in reviews. It looks great! I've got a few review comments.

Thanks for the suggestions! I've updated the patch now.

@bomsybomsy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. LGTM!

In an indexed map, the offset line & column are stored 1-based. However, the
lookup for originalPositionFor was not incrementing the 0-based column from the
API argument.
@takikawa
takikawaforce-pushed the fix-section-lookup-off-by-one branch from 3789341 to 79aa958CompareMay 29, 2024 15:57
@takikawa

Copy link
Copy Markdown
ContributorAuthor

There was a linter failure in CI, but should be fixed now (looks like the CI might need approval again to run).

Sign up for freeto 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.

2 participants

@takikawa@bomsy