summaryrefslogtreecommitdiff
path: root/platform/script-debugger/backend/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'platform/script-debugger/backend/src/org')
-rw-r--r--platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMap.java9
-rw-r--r--platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java12
2 files changed, 17 insertions, 4 deletions
diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMap.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMap.java
index a69b3af26f69..057d96fd01eb 100644
--- a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMap.java
+++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMap.java
@@ -16,16 +16,23 @@ public class SourceMap {
private final String outFile;
private final SourceResolver sourceResolver;
+ private final boolean hasNameMappings;
// sources - is not originally specified, but canonicalized/normalized
public SourceMap(@Nullable String outFile,
@NotNull MappingList mappings,
@NotNull MappingList[] sourceIndexToMappings,
- @NotNull SourceResolver sourceResolver) {
+ @NotNull SourceResolver sourceResolver,
+ boolean hasNameMappings) {
this.outFile = outFile;
this.mappings = mappings;
this.sourceIndexToMappings = sourceIndexToMappings;
this.sourceResolver = sourceResolver;
+ this.hasNameMappings = hasNameMappings;
+ }
+
+ public boolean hasNameMappings() {
+ return hasNameMappings;
}
@NotNull
diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java
index 27bd8abfe0ce..88ed91ce0580 100644
--- a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java
+++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java
@@ -5,6 +5,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.util.text.StringUtilRt;
import com.intellij.util.PathUtil;
import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.text.CharSequenceSubSequence;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -131,7 +132,12 @@ public final class SourceMapDecoder {
if (reader.peek() != JsonToken.END_ARRAY) {
sourcesContent = new SmartList<String>();
do {
- sourcesContent.add(StringUtilRt.convertLineSeparators(reader.nextString()));
+ if (reader.peek() == JsonToken.STRING) {
+ sourcesContent.add(StringUtilRt.convertLineSeparators(reader.nextString()));
+ }
+ else {
+ reader.skipValue();
+ }
}
while (reader.hasNext());
}
@@ -176,7 +182,7 @@ public final class SourceMapDecoder {
sourceToEntries[i] = new SourceMappingList(entries);
}
}
- return new SourceMap(file, new GeneratedMappingList(mappings), sourceToEntries, sourceResolverFactory.create(sources, sourcesContent));
+ return new SourceMap(file, new GeneratedMappingList(mappings), sourceToEntries, sourceResolverFactory.create(sources, sourcesContent), !ContainerUtil.isEmpty(names));
}
@Nullable
@@ -429,4 +435,4 @@ public final class SourceMapDecoder {
return MAPPING_COMPARATOR_BY_GENERATED_POSITION;
}
}
-} \ No newline at end of file
+}