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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 debuggerModel, scriptId, sourceURL, startLine, startColumn, endLine, endCo
lumn, executionContextId, hash, | 48 debuggerModel, scriptId, sourceURL, startLine, startColumn, endLine, endCo
lumn, executionContextId, hash, |
49 isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length) { | 49 isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length) { |
50 this.debuggerModel = debuggerModel; | 50 this.debuggerModel = debuggerModel; |
51 this.scriptId = scriptId; | 51 this.scriptId = scriptId; |
52 this.sourceURL = sourceURL; | 52 this.sourceURL = sourceURL; |
53 this.lineOffset = startLine; | 53 this.lineOffset = startLine; |
54 this.columnOffset = startColumn; | 54 this.columnOffset = startColumn; |
55 this.endLine = endLine; | 55 this.endLine = endLine; |
56 this.endColumn = endColumn; | 56 this.endColumn = endColumn; |
57 | 57 |
58 this._executionContextId = executionContextId; | 58 this.executionContextId = executionContextId; |
59 this.hash = hash; | 59 this.hash = hash; |
60 this._isContentScript = isContentScript; | 60 this._isContentScript = isContentScript; |
61 this._isLiveEdit = isLiveEdit; | 61 this._isLiveEdit = isLiveEdit; |
62 this.sourceMapURL = sourceMapURL; | 62 this.sourceMapURL = sourceMapURL; |
63 this.hasSourceURL = hasSourceURL; | 63 this.hasSourceURL = hasSourceURL; |
64 this.contentLength = length; | 64 this.contentLength = length; |
65 this._originalContentProvider = null; | 65 this._originalContentProvider = null; |
66 this._originalSource = null; | 66 this._originalSource = null; |
67 } | 67 } |
68 | 68 |
(...skipping 21 matching lines...) Expand all Loading... |
90 * @return {boolean} | 90 * @return {boolean} |
91 */ | 91 */ |
92 isContentScript() { | 92 isContentScript() { |
93 return this._isContentScript; | 93 return this._isContentScript; |
94 } | 94 } |
95 | 95 |
96 /** | 96 /** |
97 * @return {?SDK.ExecutionContext} | 97 * @return {?SDK.ExecutionContext} |
98 */ | 98 */ |
99 executionContext() { | 99 executionContext() { |
100 return this.debuggerModel.runtimeModel().executionContext(this._executionCon
textId); | 100 return this.debuggerModel.runtimeModel().executionContext(this.executionCont
extId); |
101 } | 101 } |
102 | 102 |
103 /** | 103 /** |
104 * @return {boolean} | 104 * @return {boolean} |
105 */ | 105 */ |
106 isLiveEdit() { | 106 isLiveEdit() { |
107 return this._isLiveEdit; | 107 return this._isLiveEdit; |
108 } | 108 } |
109 | 109 |
110 /** | 110 /** |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 /** | 254 /** |
255 * @return {boolean} | 255 * @return {boolean} |
256 */ | 256 */ |
257 isInlineScript() { | 257 isInlineScript() { |
258 var startsAtZero = !this.lineOffset && !this.columnOffset; | 258 var startsAtZero = !this.lineOffset && !this.columnOffset; |
259 return !!this.sourceURL && !startsAtZero; | 259 return !!this.sourceURL && !startsAtZero; |
260 } | 260 } |
261 | 261 |
262 /** | 262 /** |
263 * @param {string} sourceMapURL | |
264 */ | |
265 addSourceMapURL(sourceMapURL) { | |
266 if (this.sourceMapURL) | |
267 return; | |
268 this.sourceMapURL = sourceMapURL; | |
269 this.debuggerModel.dispatchEventToListeners(SDK.DebuggerModel.Events.SourceM
apURLAdded, this); | |
270 } | |
271 | |
272 /** | |
273 * @return {boolean} | 263 * @return {boolean} |
274 */ | 264 */ |
275 isAnonymousScript() { | 265 isAnonymousScript() { |
276 return !this.sourceURL; | 266 return !this.sourceURL; |
277 } | 267 } |
278 | 268 |
279 /** | 269 /** |
280 * @return {boolean} | 270 * @return {boolean} |
281 */ | 271 */ |
282 isInlineScriptWithSourceURL() { | 272 isInlineScriptWithSourceURL() { |
(...skipping 20 matching lines...) Expand all Loading... |
303 function callback(error) { | 293 function callback(error) { |
304 if (error) | 294 if (error) |
305 console.error(error); | 295 console.error(error); |
306 fulfill(!error); | 296 fulfill(!error); |
307 } | 297 } |
308 } | 298 } |
309 } | 299 } |
310 }; | 300 }; |
311 | 301 |
312 SDK.Script.sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; | 302 SDK.Script.sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; |
OLD | NEW |