OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 | 1118 |
1119 this._wrapperElement.appendChild(this.contentElement()); | 1119 this._wrapperElement.appendChild(this.contentElement()); |
1120 return this._wrapperElement; | 1120 return this._wrapperElement; |
1121 }, | 1121 }, |
1122 | 1122 |
1123 /** | 1123 /** |
1124 * @param {!TreeElement} parentTreeElement | 1124 * @param {!TreeElement} parentTreeElement |
1125 */ | 1125 */ |
1126 _populateStackTraceTreeElement: function(parentTreeElement) | 1126 _populateStackTraceTreeElement: function(parentTreeElement) |
1127 { | 1127 { |
1128 /** | 1128 var target = this._target(); |
1129 * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace | 1129 if (!target) |
1130 * @this {WebInspector.ConsoleViewMessage} | 1130 return; |
1131 */ | 1131 var content = WebInspector.DOMPresentationUtils.buildStackTracePreviewCo
ntents(target, |
1132 function appendStackTrace(stackTrace) | 1132 this._linkifier, this._message.stackTrace, this._message.asyncStackT
race); |
1133 { | 1133 parentTreeElement.appendChild(new TreeElement(content)); |
1134 if (!stackTrace) | |
1135 return; | |
1136 | |
1137 for (var i = 0; i < stackTrace.length; i++) { | |
1138 var frame = stackTrace[i]; | |
1139 | |
1140 var content = createElementWithClass("div", "stacktrace-entry"); | |
1141 var functionName = WebInspector.beautifyFunctionName(frame.funct
ionName); | |
1142 if (frame.scriptId) { | |
1143 var urlElement = this._linkifyCallFrame(frame); | |
1144 if (!urlElement) | |
1145 continue; | |
1146 content.appendChild(urlElement); | |
1147 content.createTextChild(" "); | |
1148 } | |
1149 | |
1150 content.createChild("span", "console-message-text source-code").
textContent = functionName; | |
1151 parentTreeElement.appendChild(new TreeElement(content)); | |
1152 } | |
1153 } | |
1154 | |
1155 appendStackTrace.call(this, this._message.stackTrace); | |
1156 | |
1157 for (var asyncTrace = this._message.asyncStackTrace; asyncTrace; asyncTr
ace = asyncTrace.asyncStackTrace) { | |
1158 if (!asyncTrace.callFrames || !asyncTrace.callFrames.length) | |
1159 break; | |
1160 var content = createElementWithClass("div", "stacktrace-entry"); | |
1161 var description = WebInspector.asyncStackTraceLabel(asyncTrace.descr
iption); | |
1162 content.createChild("span", "console-message-text source-code consol
e-async-trace-text").textContent = description; | |
1163 parentTreeElement.appendChild(new TreeElement(content)); | |
1164 appendStackTrace.call(this, asyncTrace.callFrames); | |
1165 } | |
1166 }, | 1134 }, |
1167 | 1135 |
1168 resetIncrementRepeatCount: function() | 1136 resetIncrementRepeatCount: function() |
1169 { | 1137 { |
1170 this._repeatCount = 1; | 1138 this._repeatCount = 1; |
1171 if (!this._repeatCountElement) | 1139 if (!this._repeatCountElement) |
1172 return; | 1140 return; |
1173 | 1141 |
1174 this._repeatCountElement.remove(); | 1142 this._repeatCountElement.remove(); |
1175 delete this._repeatCountElement; | 1143 delete this._repeatCountElement; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 { | 1397 { |
1430 if (!this._wrapperElement) { | 1398 if (!this._wrapperElement) { |
1431 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this
); | 1399 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this
); |
1432 this._wrapperElement.classList.toggle("collapsed", this._collapsed); | 1400 this._wrapperElement.classList.toggle("collapsed", this._collapsed); |
1433 } | 1401 } |
1434 return this._wrapperElement; | 1402 return this._wrapperElement; |
1435 }, | 1403 }, |
1436 | 1404 |
1437 __proto__: WebInspector.ConsoleViewMessage.prototype | 1405 __proto__: WebInspector.ConsoleViewMessage.prototype |
1438 } | 1406 } |
OLD | NEW |