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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 return /** @type {string} */ (InjectedScriptHost.callFunction(Sy mbol.prototype.toString, obj)) || "Symbol"; 1205 return /** @type {string} */ (InjectedScriptHost.callFunction(Sy mbol.prototype.toString, obj)) || "Symbol";
1206 } catch (e) { 1206 } catch (e) {
1207 return "Symbol"; 1207 return "Symbol";
1208 } 1208 }
1209 } 1209 }
1210 1210
1211 if (InjectedScriptHost.subtype(obj) === "error") { 1211 if (InjectedScriptHost.subtype(obj) === "error") {
1212 try { 1212 try {
1213 var stack = obj.stack; 1213 var stack = obj.stack;
1214 var message = obj.message && obj.message.length ? ": " + obj.mes sage : ""; 1214 var message = obj.message && obj.message.length ? ": " + obj.mes sage : "";
1215 var stackMessageEnd = stack ? indexOf(stack, "\n") : -1; 1215 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
1216 var stackMessageEnd = firstCallFrame ? firstCallFrame.index : -1 ;
1216 if (stackMessageEnd !== -1) { 1217 if (stackMessageEnd !== -1) {
1217 var stackTrace = stack.substr(stackMessageEnd + 1); 1218 var stackTrace = stack.substr(stackMessageEnd);
1218 return className + message + "\n" + stackTrace; 1219 return className + message + "\n" + stackTrace;
1219 } 1220 }
1220 return className + message; 1221 return className + message;
1221 } catch(e) { 1222 } catch(e) {
1222 } 1223 }
1223 } 1224 }
1224 1225
1225 return className; 1226 return className;
1226 }, 1227 },
1227 1228
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 */ 2027 */
2027 _logEvent: function(event) 2028 _logEvent: function(event)
2028 { 2029 {
2029 inspectedGlobalObject.console.log(event.type, event); 2030 inspectedGlobalObject.console.log(event.type, event);
2030 } 2031 }
2031 } 2032 }
2032 2033
2033 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 2034 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
2034 return injectedScript; 2035 return injectedScript;
2035 }) 2036 })
OLDNEW
« 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