Skip to content

Commit

Permalink
fix: Correctly flatten index sourcemaps (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Oct 10, 2023
1 parent 8001e1c commit c3ab912
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Various fixes and improvements

- fix: Fixed a bug in index sourcemap flattening (#74) by @loewenheim

## 7.0.0

### Various fixes and improvements
Expand Down
7 changes: 6 additions & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,9 +1133,14 @@ impl SourceMapIndex {
};

for token in map.tokens() {
let dst_col = if token.get_dst_line() == 0 {
token.get_dst_col() + off_col
} else {
token.get_dst_col()
};
let raw = builder.add(
token.get_dst_line() + off_line,
token.get_dst_col() + off_col,
dst_col,
token.get_src_line(),
token.get_src_col(),
token.get_source(),
Expand Down

0 comments on commit c3ab912

Please sign in to comment.