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

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: addressed comments 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 2d2cb4fe8277b8a79978c94d65e69b124ed4fa2f..21890a531b022b2b2a64301a6d6a546849a79c90 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -615,24 +615,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);
}
this.selectedCallFrame().evaluate(code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, didEvaluate.bind(this));
@@ -1070,7 +1067,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)
{
@@ -1083,10 +1080,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