| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |