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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2284123002: [DevTools] Format console.log(new Error()) same as console.log(new Error().stack) (Closed)
Patch Set: removed elipsis 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/ConsoleViewMessage.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
index 68fb24cbe1c6b2e8f8f597c8958cbbe543b55c00..d756b77903792d13bb761f5cd8286afeac49b991 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -180,7 +180,6 @@ WebInspector.ConsoleViewMessage.prototype = {
default:
if (consoleMessage.parameters && consoleMessage.parameters.length === 1 && consoleMessage.parameters[0].type === "string")
this._messageElement = this._tryFormatAsError(/** @type {string} */(consoleMessage.parameters[0].value));
-
var args = consoleMessage.parameters || [consoleMessage.messageText];
this._messageElement = this._messageElement || this._format(args);
}
@@ -612,22 +611,8 @@ WebInspector.ConsoleViewMessage.prototype = {
_formatParameterAsError: function(output, elem)
{
var span = elem.createChild("span", "object-value-error source-code");
- var text = output.description || "";
- var lines = text.split("\n", 2);
- span.appendChild(WebInspector.linkifyStringAsFragment(lines[0]));
- if (lines.length > 1) {
- var detailedLink = elem.createChild("a");
- detailedLink.textContent = "(\u2026)";
- function showDetailed(event)
- {
- span.removeChildren();
- detailedLink.remove();
- span.appendChild(WebInspector.linkifyStringAsFragment(text));
- event.consume(true);
- }
- detailedLink._showDetailedForTest = showDetailed.bind(null, new MouseEvent("click"));
- detailedLink.addEventListener("click", showDetailed, false);
- }
+ var errorSpan = this._tryFormatAsError(output.description || "");
+ span.appendChild(errorSpan ? errorSpan : WebInspector.linkifyStringAsFragment(output.description || ""));
},
/**

Powered by Google App Engine
This is Rietveld 408576698