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

Unified Diff: Source/devtools/front_end/ConsoleMessage.js

Issue 23717011: DevTools: Use scriptId for resolving stack frames in console messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 7 years, 3 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
« no previous file with comments | « Source/core/inspector/ScriptCallFrame.cpp ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ConsoleMessage.js
diff --git a/Source/devtools/front_end/ConsoleMessage.js b/Source/devtools/front_end/ConsoleMessage.js
index 61c147eccd4e5d8077243e70b3cec134ef440d44..b6dd57e3de6414ac96db3cb8ce69b22b6c663773 100644
--- a/Source/devtools/front_end/ConsoleMessage.js
+++ b/Source/devtools/front_end/ConsoleMessage.js
@@ -163,7 +163,7 @@ WebInspector.ConsoleMessageImpl.prototype = {
}
if (this.source !== WebInspector.ConsoleMessage.MessageSource.Network || this._request) {
- if (this._stackTrace && this._stackTrace.length && this._stackTrace[0].url) {
+ if (this._stackTrace && this._stackTrace.length && this._stackTrace[0].scriptId) {
this._anchorElement = this._linkifyCallFrame(this._stackTrace[0]);
} else if (this.url && this.url !== "undefined") {
this._anchorElement = this._linkifyLocation(this.url, this.line, this.column);
@@ -245,7 +245,11 @@ WebInspector.ConsoleMessageImpl.prototype = {
*/
_linkifyCallFrame: function(callFrame)
{
- return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
+ // FIXME(62725): stack trace line/column numbers are one-based.
+ var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0;
+ var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 : 0;
+ var rawLocation = new WebInspector.DebuggerModel.Location(callFrame.scriptId, lineNumber, columnNumber);
+ return this._linkifier.linkifyRawLocation(rawLocation, "console-message-url");
},
/**
@@ -794,7 +798,7 @@ WebInspector.ConsoleMessageImpl.prototype = {
messageTextElement.appendChild(document.createTextNode(functionName));
content.appendChild(messageTextElement);
- if (frame.url) {
+ if (frame.scriptId) {
content.appendChild(document.createTextNode(" "));
var urlElement = this._linkifyCallFrame(frame);
content.appendChild(urlElement);
« no previous file with comments | « Source/core/inspector/ScriptCallFrame.cpp ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698