summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-json-source-map-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler-core/slang-json-source-map-util.cpp')
-rw-r--r--source/compiler-core/slang-json-source-map-util.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/compiler-core/slang-json-source-map-util.cpp b/source/compiler-core/slang-json-source-map-util.cpp
index 193c812b7..30d722c4c 100644
--- a/source/compiler-core/slang-json-source-map-util.cpp
+++ b/source/compiler-core/slang-json-source-map-util.cpp
@@ -209,6 +209,7 @@ void _encode(Index v, StringBuilder& out)
cur = StringSlicePool::kNullHandle;
}
+ // Special case sourcesContent, because needs to be able to handle null or string
for (Index i = 0; i < sourcesContentCount; ++i)
{
auto value = native.sourcesContent[i];
@@ -223,6 +224,17 @@ void _encode(Index v, StringBuilder& out)
}
}
+ // Copy over the names
+ {
+ const auto namesCount = native.names.getCount();
+ outSourceMap.m_names.setCount(namesCount);
+
+ for (Index i = 0; i < namesCount; ++i)
+ {
+ outSourceMap.m_names[i] = outSourceMap.m_slicePool.add(native.names[i]);
+ }
+ }
+
List<UnownedStringSlice> lines;
StringUtil::split(native.mappings, ';', lines);