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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.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/console/ConsoleView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
index 1c057b0091fc9b1669ae0b1d40af2b4dc885b432..f269a7898e46e494ec742d837edf7b088be5fbe6 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -774,18 +774,17 @@ WebInspector.ConsoleView.prototype = {
/**
* @param {?WebInspector.RemoteObject} result
- * @param {boolean} wasThrown
* @param {!WebInspector.ConsoleMessage} originatingConsoleMessage
- * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails
+ * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails
*/
- _printResult: function(result, wasThrown, originatingConsoleMessage, exceptionDetails)
+ _printResult: function(result, originatingConsoleMessage, exceptionDetails)
{
if (!result)
return;
- var level = wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log;
+ var level = !!exceptionDetails ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log;
var message;
- if (!wasThrown)
+ if (!exceptionDetails)
message = new WebInspector.ConsoleMessage(result.target(), WebInspector.ConsoleMessage.MessageSource.JS, level, "", WebInspector.ConsoleMessage.MessageType.Result, undefined, undefined, undefined, undefined, [result]);
else
message = new WebInspector.ConsoleMessage(result.target(), WebInspector.ConsoleMessage.MessageSource.JS, level, exceptionDetails.text, WebInspector.ConsoleMessage.MessageType.Result, undefined, exceptionDetails.lineNumber, exceptionDetails.columnNumber, undefined, [WebInspector.UIString("Uncaught"), result], exceptionDetails.stackTrace, undefined, undefined, exceptionDetails.scriptId);
@@ -813,10 +812,10 @@ WebInspector.ConsoleView.prototype = {
*/
_commandEvaluated: function(event)
{
- var data = /** @type {{result: ?WebInspector.RemoteObject, wasThrown: boolean, text: string, commandMessage: !WebInspector.ConsoleMessage, exceptionDetails: (?RuntimeAgent.ExceptionDetails|undefined)}} */ (event.data);
+ var data = /** @type {{result: ?WebInspector.RemoteObject, text: string, commandMessage: !WebInspector.ConsoleMessage, exceptionDetails: (!RuntimeAgent.ExceptionDetails|undefined)}} */ (event.data);
this._prompt.history().pushHistoryItem(data.text);
this._consoleHistorySetting.set(this._prompt.history().historyData().slice(-WebInspector.ConsoleView.persistedHistorySize));
- this._printResult(data.result, data.wasThrown, data.commandMessage, data.exceptionDetails);
+ this._printResult(data.result, data.commandMessage, data.exceptionDetails);
},
/**

Powered by Google App Engine
This is Rietveld 408576698