| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 this.sourceMapURL = sourceMapURL; | 51 this.sourceMapURL = sourceMapURL; |
| 52 this.hasSourceURL = hasSourceURL; | 52 this.hasSourceURL = hasSourceURL; |
| 53 /** @type {!Set.<!WebInspector.Script.Location>} */ | 53 /** @type {!Set.<!WebInspector.Script.Location>} */ |
| 54 this._locations = new Set(); | 54 this._locations = new Set(); |
| 55 /** @type {!Array.<!WebInspector.SourceMapping>} */ | 55 /** @type {!Array.<!WebInspector.SourceMapping>} */ |
| 56 this._sourceMappings = []; | 56 this._sourceMappings = []; |
| 57 } | 57 } |
| 58 | 58 |
| 59 WebInspector.Script.Events = { | 59 WebInspector.Script.Events = { |
| 60 ScriptEdited: "ScriptEdited", | 60 ScriptEdited: "ScriptEdited", |
| 61 SourceMapURLAdded: "SourceMapURLAdded", |
| 61 } | 62 } |
| 62 | 63 |
| 63 WebInspector.Script.snippetSourceURLPrefix = "snippets:///"; | 64 WebInspector.Script.snippetSourceURLPrefix = "snippets:///"; |
| 64 | 65 |
| 65 WebInspector.Script.sourceURLRegex = /\n[\040\t]*\/\/[@#]\ssourceURL=\s*(\S*?)\s
*$/mg; | 66 WebInspector.Script.sourceURLRegex = /\n[\040\t]*\/\/[@#]\ssourceURL=\s*(\S*?)\s
*$/mg; |
| 66 | 67 |
| 67 /** | 68 /** |
| 68 * @param {string} source | 69 * @param {string} source |
| 69 * @return {string} | 70 * @return {string} |
| 70 */ | 71 */ |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 /** | 207 /** |
| 207 * @return {boolean} | 208 * @return {boolean} |
| 208 */ | 209 */ |
| 209 isInlineScript: function() | 210 isInlineScript: function() |
| 210 { | 211 { |
| 211 var startsAtZero = !this.lineOffset && !this.columnOffset; | 212 var startsAtZero = !this.lineOffset && !this.columnOffset; |
| 212 return !!this.sourceURL && !startsAtZero; | 213 return !!this.sourceURL && !startsAtZero; |
| 213 }, | 214 }, |
| 214 | 215 |
| 215 /** | 216 /** |
| 217 * @param {string} sourceMapURL |
| 218 */ |
| 219 addSourceMapURL: function(sourceMapURL) |
| 220 { |
| 221 if (this.sourceMapURL) |
| 222 return; |
| 223 this.sourceMapURL = sourceMapURL; |
| 224 this.dispatchEventToListeners(WebInspector.Script.Events.SourceMapURLAdd
ed, this.sourceMapURL); |
| 225 }, |
| 226 |
| 227 /** |
| 216 * @return {boolean} | 228 * @return {boolean} |
| 217 */ | 229 */ |
| 218 isAnonymousScript: function() | 230 isAnonymousScript: function() |
| 219 { | 231 { |
| 220 return !this.sourceURL; | 232 return !this.sourceURL; |
| 221 }, | 233 }, |
| 222 | 234 |
| 223 /** | 235 /** |
| 224 * @return {boolean} | 236 * @return {boolean} |
| 225 */ | 237 */ |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 }, | 333 }, |
| 322 | 334 |
| 323 dispose: function() | 335 dispose: function() |
| 324 { | 336 { |
| 325 WebInspector.LiveLocation.prototype.dispose.call(this); | 337 WebInspector.LiveLocation.prototype.dispose.call(this); |
| 326 this._script._locations.remove(this); | 338 this._script._locations.remove(this); |
| 327 }, | 339 }, |
| 328 | 340 |
| 329 __proto__: WebInspector.LiveLocation.prototype | 341 __proto__: WebInspector.LiveLocation.prototype |
| 330 } | 342 } |
| OLD | NEW |