-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix column offset calculation in sectioned source maps
Summary: Fixes a bug in `metro-source-map`'s source map consumer implementation, where positions inside a section with a nonzero column offset would be incorrectly shifted during lookup. If `A` represents characters mapped by one section and `B` represents characters mapped by another section: ``` // Generated code 1 | AAAAAAAAAA 2 | AAAAABBBBB ^ (i) 3 | BBBBBBBBBB ^ (ii) ``` Then in order to perform a look up in the source map for section B, the positions marked above should be translated to: ``` // "B" part of generated code 1 | BBBBB ^ (i) 2 | BBBBBBBBBB ^ (ii) ``` But with the bug we instead translated them to: ``` // "B" part of generated code 1 | BBBBB ^ (i - correct) 2 | BBBBBBBBBB ^ (ii - incorrect) ``` Reviewed By: MichaReiser Differential Revision: D26166640 fbshipit-source-id: db510bf7e20b9eb9e67e06cc3dedcab95410b79b
- Loading branch information
1 parent
eb06fbd
commit 2cc5aa8
Showing
2 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters