Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js

Issue 2236033002: [DevTools] Simplify evaluation callbacks on frontend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-was-thrown
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
index b7968f0ddef3581bbe7f74fe8daadfc1ef594513..2983210548d698258c8586cfe90bde43b0fcc7d7 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -624,24 +624,21 @@ WebInspector.DebuggerModel.prototype = {
* @param {boolean} doNotPauseOnExceptionsAndMuteConsole
* @param {boolean} returnByValue
* @param {boolean} generatePreview
- * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.RemoteObject=, ?RuntimeAgent.ExceptionDetails=)} callback
+ * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetails=)} callback
*/
evaluateOnSelectedCallFrame: function(code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback)
{
/**
* @param {?RuntimeAgent.RemoteObject} result
- * @param {boolean=} wasThrown
- * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails
+ * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails
* @this {WebInspector.DebuggerModel}
*/
- function didEvaluate(result, wasThrown, exceptionDetails)
+ function didEvaluate(result, exceptionDetails)
{
if (!result)
- callback(null, false);
- else if (returnByValue)
- callback(null, !!wasThrown, wasThrown ? null : result, exceptionDetails);
+ callback(null);
else
- callback(this.target().runtimeModel.createRemoteObject(result), !!wasThrown, undefined, exceptionDetails);
+ callback(this.target().runtimeModel.createRemoteObject(result), exceptionDetails);
if (objectGroup === "console")
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame);
@@ -1084,7 +1081,7 @@ WebInspector.DebuggerModel.CallFrame.prototype = {
* @param {boolean} doNotPauseOnExceptionsAndMuteConsole
* @param {boolean} returnByValue
* @param {boolean} generatePreview
- * @param {function(?RuntimeAgent.RemoteObject, boolean=, ?RuntimeAgent.ExceptionDetails=)} callback
+ * @param {function(?RuntimeAgent.RemoteObject, !RuntimeAgent.ExceptionDetails=)} callback
*/
evaluate: function(code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback)
{
@@ -1097,10 +1094,10 @@ WebInspector.DebuggerModel.CallFrame.prototype = {
{
if (error) {
console.error(error);
- callback(null, false);
+ callback(null);
return;
}
- callback(result, !!exceptionDetails, exceptionDetails);
+ callback(result, exceptionDetails);
}
this._debuggerAgent.evaluateOnCallFrame(this._payload.callFrameId, code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, didEvaluateOnCallFrame);
},

Powered by Google App Engine
This is Rietveld 408576698