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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 return; | 107 return; |
108 } | 108 } |
109 | 109 |
110 if (content.slice(0, 3) === ")]}") | 110 if (content.slice(0, 3) === ")]}") |
111 content = content.substring(content.indexOf('\n')); | 111 content = content.substring(content.indexOf('\n')); |
112 try { | 112 try { |
113 var payload = /** @type {!SourceMapV3} */ (JSON.parse(content)); | 113 var payload = /** @type {!SourceMapV3} */ (JSON.parse(content)); |
114 var baseURL = sourceMapURL.startsWith("data:") ? compiledURL : sourc
eMapURL; | 114 var baseURL = sourceMapURL.startsWith("data:") ? compiledURL : sourc
eMapURL; |
115 callback(new WebInspector.SourceMap(compiledURL, baseURL, payload)); | 115 callback(new WebInspector.SourceMap(compiledURL, baseURL, payload)); |
116 } catch(e) { | 116 } catch(e) { |
117 console.error(e.message); | 117 console.error(e); |
118 WebInspector.console.error("Failed to parse SourceMap: " + sourceMap
URL); | 118 WebInspector.console.error("Failed to parse SourceMap: " + sourceMap
URL); |
119 callback(null); | 119 callback(null); |
120 } | 120 } |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 WebInspector.SourceMap.prototype = { | 124 WebInspector.SourceMap.prototype = { |
125 /** | 125 /** |
126 * @return {string} | 126 * @return {string} |
127 */ | 127 */ |
| 128 compiledURL: function() |
| 129 { |
| 130 return this._compiledURL; |
| 131 }, |
| 132 |
| 133 /** |
| 134 * @return {string} |
| 135 */ |
128 url: function() | 136 url: function() |
129 { | 137 { |
130 return this._sourceMappingURL; | 138 return this._sourceMappingURL; |
131 }, | 139 }, |
132 | 140 |
133 /** | 141 /** |
134 * @return {!Array.<string>} | 142 * @return {!Array.<string>} |
135 */ | 143 */ |
136 sources: function() | 144 sources: function() |
137 { | 145 { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 * @param {number=} sourceColumnNumber | 424 * @param {number=} sourceColumnNumber |
417 */ | 425 */ |
418 WebInspector.SourceMap.Entry = function(lineNumber, columnNumber, sourceURL, sou
rceLineNumber, sourceColumnNumber) | 426 WebInspector.SourceMap.Entry = function(lineNumber, columnNumber, sourceURL, sou
rceLineNumber, sourceColumnNumber) |
419 { | 427 { |
420 this.lineNumber = lineNumber; | 428 this.lineNumber = lineNumber; |
421 this.columnNumber = columnNumber; | 429 this.columnNumber = columnNumber; |
422 this.sourceURL = sourceURL; | 430 this.sourceURL = sourceURL; |
423 this.sourceLineNumber = sourceLineNumber; | 431 this.sourceLineNumber = sourceLineNumber; |
424 this.sourceColumnNumber = sourceColumnNumber; | 432 this.sourceColumnNumber = sourceColumnNumber; |
425 } | 433 } |
OLD | NEW |