From 75d7fc0eadc39d3c08a5fbf89fcdcbbf2614c1aa Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 25 Jan 2016 10:42:35 +0100 Subject: [PATCH] WEB-19983 Compiled TypeScript not stopping at breakpoints --- .../debugger/sourcemap/SourceMapDecoder.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.kt b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.kt index 1b21f03b1fd5..5af5c07aa3b6 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.kt +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.kt @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ private fun parseMap(reader: JsonReaderEx, } "sourceRoot" -> { sourceRoot = readSourcePath(reader) - if (sourceRoot != null) { + if (sourceRoot != null && sourceRoot != "/") { sourceRoot = UriUtil.trimTrailingSlashes(sourceRoot) } } @@ -237,7 +237,7 @@ private fun readMappings(value: String, } } -private fun readSources(reader: JsonReaderEx, sourceRootUrl: String?): List { +private fun readSources(reader: JsonReaderEx, sourceRoot: String?): List { reader.beginArray() val sources: List if (reader.peek() == JsonToken.END_ARRAY) { @@ -247,8 +247,13 @@ private fun readSources(reader: JsonReaderEx, sourceRootUrl: String?): List() do { var sourceUrl = readSourcePath(reader) - if (!sourceRootUrl.isNullOrEmpty()) { - sourceUrl = "$sourceRootUrl/$sourceUrl" + if (!sourceRoot.isNullOrEmpty()) { + if (sourceRoot == "/") { + sourceUrl = "/$sourceUrl" + } + else { + sourceUrl = "$sourceRoot/$sourceUrl" + } } sources.add(sourceUrl) }