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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 * @param {string} newSource | 186 * @param {string} newSource |
187 * @param {function(?Protocol.Error, !DebuggerAgent.SetScriptSourceError=, !
Array.<!DebuggerAgent.CallFrame>=, !DebuggerAgent.StackTrace=, boolean=)} callba
ck | 187 * @param {function(?Protocol.Error, !DebuggerAgent.SetScriptSourceError=, !
Array.<!DebuggerAgent.CallFrame>=, !DebuggerAgent.StackTrace=, boolean=)} callba
ck |
188 */ | 188 */ |
189 editSource: function(newSource, callback) | 189 editSource: function(newSource, callback) |
190 { | 190 { |
191 /** | 191 /** |
192 * @this {WebInspector.Script} | 192 * @this {WebInspector.Script} |
193 * @param {?Protocol.Error} error | 193 * @param {?Protocol.Error} error |
194 * @param {!DebuggerAgent.SetScriptSourceError=} errorData | 194 * @param {!DebuggerAgent.SetScriptSourceError=} errorData |
195 * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames | 195 * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames |
196 * @param {!Object=} debugData | 196 * @param {boolean=} stackChanged |
197 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace | 197 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace |
198 */ | 198 */ |
199 function didEditScriptSource(error, errorData, callFrames, debugData, as
yncStackTrace) | 199 function didEditScriptSource(error, errorData, callFrames, stackChanged,
asyncStackTrace) |
200 { | 200 { |
201 // FIXME: support debugData.stack_update_needs_step_in flag by calli
ng WebInspector.debugger_model.callStackModified | |
202 if (!error) | 201 if (!error) |
203 this._source = newSource; | 202 this._source = newSource; |
204 var needsStepIn = !!debugData && debugData["stack_update_needs_step_
in"] === true; | 203 var needsStepIn = !!stackChanged; |
205 callback(error, errorData, callFrames, asyncStackTrace, needsStepIn)
; | 204 callback(error, errorData, callFrames, asyncStackTrace, needsStepIn)
; |
206 if (!error) | 205 if (!error) |
207 this.dispatchEventToListeners(WebInspector.Script.Events.ScriptE
dited, newSource); | 206 this.dispatchEventToListeners(WebInspector.Script.Events.ScriptE
dited, newSource); |
208 } | 207 } |
209 | 208 |
210 newSource = WebInspector.Script._trimSourceURLComment(newSource); | 209 newSource = WebInspector.Script._trimSourceURLComment(newSource); |
211 // We append correct sourceURL to script for consistency only. It's not
actually needed for things to work correctly. | 210 // We append correct sourceURL to script for consistency only. It's not
actually needed for things to work correctly. |
212 newSource = this._appendSourceURLCommentIfNeeded(newSource); | 211 newSource = this._appendSourceURLCommentIfNeeded(newSource); |
213 | 212 |
214 if (this.scriptId) | 213 if (this.scriptId) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 /** | 257 /** |
259 * @return {boolean} | 258 * @return {boolean} |
260 */ | 259 */ |
261 isInlineScriptWithSourceURL: function() | 260 isInlineScriptWithSourceURL: function() |
262 { | 261 { |
263 return !!this.hasSourceURL && this.isInlineScript(); | 262 return !!this.hasSourceURL && this.isInlineScript(); |
264 }, | 263 }, |
265 | 264 |
266 __proto__: WebInspector.SDKObject.prototype | 265 __proto__: WebInspector.SDKObject.prototype |
267 } | 266 } |
OLD | NEW |