| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 WebInspector.ExecutionContext.prototype = { | 197 WebInspector.ExecutionContext.prototype = { |
| 198 | 198 |
| 199 /** | 199 /** |
| 200 * @param {string} expression | 200 * @param {string} expression |
| 201 * @param {string} objectGroup | 201 * @param {string} objectGroup |
| 202 * @param {boolean} includeCommandLineAPI | 202 * @param {boolean} includeCommandLineAPI |
| 203 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole | 203 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole |
| 204 * @param {boolean} returnByValue | 204 * @param {boolean} returnByValue |
| 205 * @param {boolean} generatePreview | 205 * @param {boolean} generatePreview |
| 206 * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.Remot
eObject=)} callback | 206 * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.Remot
eObject=, ?DebuggerAgent.ExceptionDetails=)} callback |
| 207 */ | 207 */ |
| 208 evaluate: function(expression, objectGroup, includeCommandLineAPI, doNotPaus
eOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback) | 208 evaluate: function(expression, objectGroup, includeCommandLineAPI, doNotPaus
eOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback) |
| 209 { | 209 { |
| 210 //FIXME: It will be moved to separate ExecutionContext | 210 //FIXME: It will be moved to separate ExecutionContext |
| 211 if (this._debuggerModel.selectedCallFrame()) { | 211 if (this._debuggerModel.selectedCallFrame()) { |
| 212 this._debuggerModel.evaluateOnSelectedCallFrame(expression, objectGr
oup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue,
generatePreview, callback); | 212 this._debuggerModel.evaluateOnSelectedCallFrame(expression, objectGr
oup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue,
generatePreview, callback); |
| 213 return; | 213 return; |
| 214 } | 214 } |
| 215 | 215 |
| 216 if (!expression) { | 216 if (!expression) { |
| 217 // There is no expression, so the completion should happen against g
lobal properties. | 217 // There is no expression, so the completion should happen against g
lobal properties. |
| 218 expression = "this"; | 218 expression = "this"; |
| 219 } | 219 } |
| 220 | 220 |
| 221 /** | 221 /** |
| 222 * @this {WebInspector.ExecutionContext} | 222 * @this {WebInspector.ExecutionContext} |
| 223 * @param {?Protocol.Error} error | 223 * @param {?Protocol.Error} error |
| 224 * @param {!RuntimeAgent.RemoteObject} result | 224 * @param {!RuntimeAgent.RemoteObject} result |
| 225 * @param {boolean=} wasThrown | 225 * @param {boolean=} wasThrown |
| 226 * @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails |
| 226 */ | 227 */ |
| 227 function evalCallback(error, result, wasThrown) | 228 function evalCallback(error, result, wasThrown, exceptionDetails) |
| 228 { | 229 { |
| 229 if (error) { | 230 if (error) { |
| 230 callback(null, false); | 231 callback(null, false); |
| 231 return; | 232 return; |
| 232 } | 233 } |
| 233 | 234 |
| 234 if (returnByValue) | 235 if (returnByValue) |
| 235 callback(null, !!wasThrown, wasThrown ? null : result); | 236 callback(null, !!wasThrown, wasThrown ? null : result, exception
Details); |
| 236 else | 237 else |
| 237 callback(this.target().runtimeModel.createRemoteObject(result),
!!wasThrown); | 238 callback(this.target().runtimeModel.createRemoteObject(result),
!!wasThrown, undefined, exceptionDetails); |
| 238 } | 239 } |
| 239 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo
mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene
ratePreview, evalCallback.bind(this)); | 240 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo
mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene
ratePreview, evalCallback.bind(this)); |
| 240 }, | 241 }, |
| 241 | 242 |
| 242 /** | 243 /** |
| 243 * @param {string} expressionString | 244 * @param {string} expressionString |
| 244 * @param {string} prefix | 245 * @param {string} prefix |
| 245 * @param {boolean} force | 246 * @param {boolean} force |
| 246 * @param {function(!Array.<string>, number=)} completionsReadyCallback | 247 * @param {function(!Array.<string>, number=)} completionsReadyCallback |
| 247 */ | 248 */ |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 completionsReadyCallback(results); | 401 completionsReadyCallback(results); |
| 401 }, | 402 }, |
| 402 | 403 |
| 403 __proto__: WebInspector.SDKObject.prototype | 404 __proto__: WebInspector.SDKObject.prototype |
| 404 } | 405 } |
| 405 | 406 |
| 406 /** | 407 /** |
| 407 * @type {!WebInspector.RuntimeModel} | 408 * @type {!WebInspector.RuntimeModel} |
| 408 */ | 409 */ |
| 409 WebInspector.runtimeModel; | 410 WebInspector.runtimeModel; |
| OLD | NEW |