Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 }) |
| OLD | NEW |