Skip to content

Commit

Permalink
skip nulls in source map finalization (#4011)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 20, 2024
1 parent 4b9322f commit 79fd0b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/sourcemap/sourcemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ func (pieces SourceMapPieces) Finalize(shifts []SourceMapShift) []byte {

potentialStartOfRun := current

// Skip over the original position information
_, current = DecodeVLQ(pieces.Mappings, current) // The original source
_, current = DecodeVLQ(pieces.Mappings, current) // The original line
_, current = DecodeVLQ(pieces.Mappings, current) // The original column

// Skip over the original name
// Skip over the original position information if present
if current < len(pieces.Mappings) {
if c := pieces.Mappings[current]; c != ',' && c != ';' {
_, current = DecodeVLQ(pieces.Mappings, current) // The original source
_, current = DecodeVLQ(pieces.Mappings, current) // The original line
_, current = DecodeVLQ(pieces.Mappings, current) // The original column

// Skip over the original name if present
if current < len(pieces.Mappings) {
_, current = DecodeVLQ(pieces.Mappings, current)
}
}
Expand Down

0 comments on commit 79fd0b0

Please sign in to comment.