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 22 matching lines...) Expand all Loading... |
33 * @param {string} scriptId | 33 * @param {string} scriptId |
34 * @param {string} sourceURL | 34 * @param {string} sourceURL |
35 * @param {number} startLine | 35 * @param {number} startLine |
36 * @param {number} startColumn | 36 * @param {number} startColumn |
37 * @param {number} endLine | 37 * @param {number} endLine |
38 * @param {number} endColumn | 38 * @param {number} endColumn |
39 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId | 39 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId |
40 * @param {string} hash | 40 * @param {string} hash |
41 * @param {boolean} isContentScript | 41 * @param {boolean} isContentScript |
42 * @param {boolean} isLiveEdit | 42 * @param {boolean} isLiveEdit |
43 * @param {string=} sourceMapURL | 43 * @param {string|undefined} sourceMapURL |
44 * @param {boolean=} hasSourceURL | 44 * @param {boolean} hasSourceURL |
| 45 * @param {number} length |
45 */ | 46 */ |
46 constructor( | 47 constructor( |
47 debuggerModel, | 48 debuggerModel, scriptId, sourceURL, startLine, startColumn, endLine, endCo
lumn, executionContextId, hash, |
48 scriptId, | 49 isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length) { |
49 sourceURL, | |
50 startLine, | |
51 startColumn, | |
52 endLine, | |
53 endColumn, | |
54 executionContextId, | |
55 hash, | |
56 isContentScript, | |
57 isLiveEdit, | |
58 sourceMapURL, | |
59 hasSourceURL) { | |
60 this.debuggerModel = debuggerModel; | 50 this.debuggerModel = debuggerModel; |
61 this.scriptId = scriptId; | 51 this.scriptId = scriptId; |
62 this.sourceURL = sourceURL; | 52 this.sourceURL = sourceURL; |
63 this.lineOffset = startLine; | 53 this.lineOffset = startLine; |
64 this.columnOffset = startColumn; | 54 this.columnOffset = startColumn; |
65 this.endLine = endLine; | 55 this.endLine = endLine; |
66 this.endColumn = endColumn; | 56 this.endColumn = endColumn; |
67 | 57 |
68 this._executionContextId = executionContextId; | 58 this._executionContextId = executionContextId; |
69 this.hash = hash; | 59 this.hash = hash; |
70 this._isContentScript = isContentScript; | 60 this._isContentScript = isContentScript; |
71 this._isLiveEdit = isLiveEdit; | 61 this._isLiveEdit = isLiveEdit; |
72 this.sourceMapURL = sourceMapURL; | 62 this.sourceMapURL = sourceMapURL; |
73 this.hasSourceURL = hasSourceURL; | 63 this.hasSourceURL = hasSourceURL; |
| 64 this.contentLength = length; |
74 this._originalContentProvider = null; | 65 this._originalContentProvider = null; |
75 this._originalSource = null; | 66 this._originalSource = null; |
76 } | 67 } |
77 | 68 |
78 /** | 69 /** |
79 * @param {string} source | 70 * @param {string} source |
80 * @return {string} | 71 * @return {string} |
81 */ | 72 */ |
82 static _trimSourceURLComment(source) { | 73 static _trimSourceURLComment(source) { |
83 var sourceURLIndex = source.lastIndexOf('//# sourceURL='); | 74 var sourceURLIndex = source.lastIndexOf('//# sourceURL='); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 function callback(error) { | 337 function callback(error) { |
347 if (error) | 338 if (error) |
348 console.error(error); | 339 console.error(error); |
349 fulfill(!error); | 340 fulfill(!error); |
350 } | 341 } |
351 } | 342 } |
352 } | 343 } |
353 }; | 344 }; |
354 | 345 |
355 SDK.Script.sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; | 346 SDK.Script.sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; |
OLD | NEW |