Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1451)

Unified Diff: Source/devtools/front_end/SourceMap.js

Issue 13898010: Fix the way sourceRoot is resolved in source maps. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl dcommit --bypass-hooks Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/inspector/compiler-script-mapping-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/SourceMap.js
diff --git a/Source/devtools/front_end/SourceMap.js b/Source/devtools/front_end/SourceMap.js
index ba8225d401cad7b17469df2454d96b4a738b0c73..4615308a7753ea12bdc01ec7ab459ff574a8313e 100644
--- a/Source/devtools/front_end/SourceMap.js
+++ b/Source/devtools/front_end/SourceMap.js
@@ -171,7 +171,10 @@ WebInspector.SourceMap.prototype = {
var originalToCanonicalURLMap = {};
for (var i = 0; i < map.sources.length; ++i) {
var originalSourceURL = map.sources[i];
- var href = (map.sourceRoot ? map.sourceRoot + "/" : "") + originalSourceURL;
+ var sourceRoot = map.sourceRoot || "";
+ if (sourceRoot && !sourceRoot.endsWith("/"))
+ sourceRoot += "/";
+ var href = sourceRoot + originalSourceURL;
var url = WebInspector.ParsedURL.completeURL(this._sourceMappingURL, href) || href;
originalToCanonicalURLMap[originalSourceURL] = url;
sources.push(url);
« no previous file with comments | « LayoutTests/http/tests/inspector/compiler-script-mapping-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698