Skip to content

Commit 79fd0b0

Browse files
committed
skip nulls in source map finalization (#4011)
1 parent 4b9322f commit 79fd0b0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

internal/sourcemap/sourcemap.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,14 @@ func (pieces SourceMapPieces) Finalize(shifts []SourceMapShift) []byte {
316316

317317
potentialStartOfRun := current
318318

319-
// Skip over the original position information
320-
_, current = DecodeVLQ(pieces.Mappings, current) // The original source
321-
_, current = DecodeVLQ(pieces.Mappings, current) // The original line
322-
_, current = DecodeVLQ(pieces.Mappings, current) // The original column
323-
324-
// Skip over the original name
319+
// Skip over the original position information if present
325320
if current < len(pieces.Mappings) {
326-
if c := pieces.Mappings[current]; c != ',' && c != ';' {
321+
_, current = DecodeVLQ(pieces.Mappings, current) // The original source
322+
_, current = DecodeVLQ(pieces.Mappings, current) // The original line
323+
_, current = DecodeVLQ(pieces.Mappings, current) // The original column
324+
325+
// Skip over the original name if present
326+
if current < len(pieces.Mappings) {
327327
_, current = DecodeVLQ(pieces.Mappings, current)
328328
}
329329
}

0 commit comments

Comments
 (0)