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

Unified Diff: Source/core/inspector/InjectedScriptSource.js

Issue 1186093002: [DevTools] Fixed multiline error messages (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScriptSource.js
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index 2dd90d51ef58a36651fc9e4e59a70448b46c1914..46b940105a827bb3452a9627e01fd9f0c03d1701 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -1212,9 +1212,10 @@ InjectedScript.prototype = {
try {
var stack = obj.stack;
var message = obj.message && obj.message.length ? ": " + obj.message : "";
- var stackMessageEnd = stack ? indexOf(stack, "\n") : -1;
+ var firstCallFrame = /^\s*at\s/m.exec(stack);
yurys 2015/06/15 14:21:51 I believe stack frames always start with " at ", i
kozy 2015/06/16 10:22:53 Yes, it starts from spaces. This line is generated
+ var stackMessageEnd = firstCallFrame ? firstCallFrame.index : -1;
if (stackMessageEnd !== -1) {
- var stackTrace = stack.substr(stackMessageEnd + 1);
+ var stackTrace = stack.substr(stackMessageEnd);
return className + message + "\n" + stackTrace;
}
return className + message;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698