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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/http/tests/inspector/compiler-script-mapping-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 { 164 {
165 var sourceIndex = 0; 165 var sourceIndex = 0;
166 var sourceLineNumber = 0; 166 var sourceLineNumber = 0;
167 var sourceColumnNumber = 0; 167 var sourceColumnNumber = 0;
168 var nameIndex = 0; 168 var nameIndex = 0;
169 169
170 var sources = []; 170 var sources = [];
171 var originalToCanonicalURLMap = {}; 171 var originalToCanonicalURLMap = {};
172 for (var i = 0; i < map.sources.length; ++i) { 172 for (var i = 0; i < map.sources.length; ++i) {
173 var originalSourceURL = map.sources[i]; 173 var originalSourceURL = map.sources[i];
174 var href = (map.sourceRoot ? map.sourceRoot + "/" : "") + originalSo urceURL; 174 var sourceRoot = map.sourceRoot || "";
175 if (sourceRoot && !sourceRoot.endsWith("/"))
176 sourceRoot += "/";
177 var href = sourceRoot + originalSourceURL;
175 var url = WebInspector.ParsedURL.completeURL(this._sourceMappingURL, href) || href; 178 var url = WebInspector.ParsedURL.completeURL(this._sourceMappingURL, href) || href;
176 originalToCanonicalURLMap[originalSourceURL] = url; 179 originalToCanonicalURLMap[originalSourceURL] = url;
177 sources.push(url); 180 sources.push(url);
178 this._sources[url] = true; 181 this._sources[url] = true;
179 182
180 if (map.sourcesContent && map.sourcesContent[i]) 183 if (map.sourcesContent && map.sourcesContent[i])
181 this._sourceContentByURL[url] = map.sourcesContent[i]; 184 this._sourceContentByURL[url] = map.sourcesContent[i];
182 } 185 }
183 186
184 var stringCharIterator = new WebInspector.SourceMap.StringCharIterator(m ap.mappings); 187 var stringCharIterator = new WebInspector.SourceMap.StringCharIterator(m ap.mappings);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 }, 296 },
294 297
295 /** 298 /**
296 * @return {boolean} 299 * @return {boolean}
297 */ 300 */
298 hasNext: function() 301 hasNext: function()
299 { 302 {
300 return this._position < this._string.length; 303 return this._position < this._string.length;
301 } 304 }
302 } 305 }
OLDNEW
« 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