From 79fd0b0ccc911a8e1571b83f25deec1b18d0ed10 Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Fri, 20 Dec 2024 12:47:01 -0500 Subject: [PATCH] skip nulls in source map finalization (#4011) --- internal/sourcemap/sourcemap.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/sourcemap/sourcemap.go b/internal/sourcemap/sourcemap.go index 40888222d7..4d759dbbae 100644 --- a/internal/sourcemap/sourcemap.go +++ b/internal/sourcemap/sourcemap.go @@ -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) } }