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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 * @param {function(?Protocol.Error, !RuntimeAgent.ExceptionDetails=, !Array
.<!DebuggerAgent.CallFrame>=, !RuntimeAgent.StackTrace=, boolean=)} callback | 237 * @param {function(?Protocol.Error, !RuntimeAgent.ExceptionDetails=, !Array
.<!DebuggerAgent.CallFrame>=, !RuntimeAgent.StackTrace=, boolean=)} callback |
238 */ | 238 */ |
239 editSource: function(newSource, callback) | 239 editSource: function(newSource, callback) |
240 { | 240 { |
241 /** | 241 /** |
242 * @this {WebInspector.Script} | 242 * @this {WebInspector.Script} |
243 * @param {?Protocol.Error} error | 243 * @param {?Protocol.Error} error |
244 * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames | 244 * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames |
245 * @param {boolean=} stackChanged | 245 * @param {boolean=} stackChanged |
246 * @param {!RuntimeAgent.StackTrace=} asyncStackTrace | 246 * @param {!RuntimeAgent.StackTrace=} asyncStackTrace |
247 * @param {!RuntimeAgent.ExceptionDetails=} compileError | 247 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails |
248 */ | 248 */ |
249 function didEditScriptSource(error, callFrames, stackChanged, asyncStack
Trace, compileError) | 249 function didEditScriptSource(error, callFrames, stackChanged, asyncStack
Trace, exceptionDetails) |
250 { | 250 { |
251 if (!error && !compileError) | 251 if (!error && !exceptionDetails) |
252 this._source = newSource; | 252 this._source = newSource; |
253 var needsStepIn = !!stackChanged; | 253 var needsStepIn = !!stackChanged; |
254 callback(error, compileError, callFrames, asyncStackTrace, needsStep
In); | 254 callback(error, exceptionDetails, callFrames, asyncStackTrace, needs
StepIn); |
255 } | 255 } |
256 | 256 |
257 newSource = WebInspector.Script._trimSourceURLComment(newSource); | 257 newSource = WebInspector.Script._trimSourceURLComment(newSource); |
258 // We append correct sourceURL to script for consistency only. It's not
actually needed for things to work correctly. | 258 // We append correct sourceURL to script for consistency only. It's not
actually needed for things to work correctly. |
259 newSource = this._appendSourceURLCommentIfNeeded(newSource); | 259 newSource = this._appendSourceURLCommentIfNeeded(newSource); |
260 | 260 |
261 if (this.scriptId) | 261 if (this.scriptId) |
262 this.target().debuggerAgent().setScriptSource(this.scriptId, newSour
ce, undefined, didEditScriptSource.bind(this)); | 262 this.target().debuggerAgent().setScriptSource(this.scriptId, newSour
ce, undefined, didEditScriptSource.bind(this)); |
263 else | 263 else |
264 callback("Script failed to parse"); | 264 callback("Script failed to parse"); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 { | 333 { |
334 if (error) | 334 if (error) |
335 console.error(error); | 335 console.error(error); |
336 fulfill(!error); | 336 fulfill(!error); |
337 } | 337 } |
338 } | 338 } |
339 }, | 339 }, |
340 | 340 |
341 __proto__: WebInspector.SDKObject.prototype | 341 __proto__: WebInspector.SDKObject.prototype |
342 } | 342 } |
OLD | NEW |