| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 this._messageElement = this._format([consoleMessage.messageT
ext]); | 190 this._messageElement = this._format([consoleMessage.messageT
ext]); |
| 191 } | 191 } |
| 192 } else { | 192 } else { |
| 193 var args = consoleMessage.parameters || [consoleMessage.messageT
ext]; | 193 var args = consoleMessage.parameters || [consoleMessage.messageT
ext]; |
| 194 this._messageElement = this._format(args); | 194 this._messageElement = this._format(args); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 if (consoleMessage.source !== WebInspector.ConsoleMessage.MessageSource.
Network || consoleMessage.request) { | 198 if (consoleMessage.source !== WebInspector.ConsoleMessage.MessageSource.
Network || consoleMessage.request) { |
| 199 var callFrame = this._callFrameAnchorFromStackTrace(consoleMessage.s
tackTrace); | 199 var useBlackboxing = (consoleMessage.source === WebInspector.Console
Message.MessageSource.ConsoleAPI); |
| 200 var callFrame = this._callFrameAnchorFromStackTrace(consoleMessage.s
tackTrace, useBlackboxing); |
| 200 if (callFrame) | 201 if (callFrame) |
| 201 this._anchorElement = this._linkifyCallFrame(callFrame); | 202 this._anchorElement = this._linkifyCallFrame(callFrame); |
| 202 else if (consoleMessage.url && consoleMessage.url !== "undefined") | 203 else if (consoleMessage.url && consoleMessage.url !== "undefined") |
| 203 this._anchorElement = this._linkifyLocation(consoleMessage.url,
consoleMessage.line, consoleMessage.column); | 204 this._anchorElement = this._linkifyLocation(consoleMessage.url,
consoleMessage.line, consoleMessage.column); |
| 204 } | 205 } |
| 205 | 206 |
| 206 this._formattedMessage.appendChild(this._messageElement); | 207 this._formattedMessage.appendChild(this._messageElement); |
| 207 if (this._anchorElement) { | 208 if (this._anchorElement) { |
| 208 this._formattedMessage.appendChild(document.createTextNode(" ")); | 209 this._formattedMessage.appendChild(document.createTextNode(" ")); |
| 209 this._formattedMessage.appendChild(this._anchorElement); | 210 this._formattedMessage.appendChild(this._anchorElement); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 console.assert(this._linkifier); | 279 console.assert(this._linkifier); |
| 279 var target = this._target(); | 280 var target = this._target(); |
| 280 if (!this._linkifier) | 281 if (!this._linkifier) |
| 281 return null; | 282 return null; |
| 282 | 283 |
| 283 return this._linkifier.linkifyConsoleCallFrame(target, callFrame, "conso
le-message-url"); | 284 return this._linkifier.linkifyConsoleCallFrame(target, callFrame, "conso
le-message-url"); |
| 284 }, | 285 }, |
| 285 | 286 |
| 286 /** | 287 /** |
| 287 * @param {?Array.<!ConsoleAgent.CallFrame>} stackTrace | 288 * @param {?Array.<!ConsoleAgent.CallFrame>} stackTrace |
| 289 * @param {boolean} useBlackboxing |
| 288 * @return {?ConsoleAgent.CallFrame} | 290 * @return {?ConsoleAgent.CallFrame} |
| 289 */ | 291 */ |
| 290 _callFrameAnchorFromStackTrace: function(stackTrace) | 292 _callFrameAnchorFromStackTrace: function(stackTrace, useBlackboxing) |
| 291 { | 293 { |
| 292 if (!stackTrace || !stackTrace.length) | 294 if (!stackTrace || !stackTrace.length) |
| 293 return null; | 295 return null; |
| 294 var callFrame = stackTrace[0].scriptId ? stackTrace[0] : null; | 296 var callFrame = stackTrace[0].scriptId ? stackTrace[0] : null; |
| 297 if (!useBlackboxing) |
| 298 return callFrame; |
| 295 if (!WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnabl
ed()) | 299 if (!WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnabl
ed()) |
| 296 return callFrame; | 300 return callFrame; |
| 297 var regex = WebInspector.settings.skipStackFramesPattern.asRegExp(); | |
| 298 if (!regex) | |
| 299 return callFrame; | |
| 300 for (var i = 0; i < stackTrace.length; ++i) { | 301 for (var i = 0; i < stackTrace.length; ++i) { |
| 301 var script = this._target().debuggerModel.scriptForId(stackTrace[i].
scriptId); | 302 if (!WebInspector.BlackboxSupport.isBlackboxedURL(stackTrace[i].url)
) |
| 302 if (!script || !regex.test(script.sourceURL)) | |
| 303 return stackTrace[i].scriptId ? stackTrace[i] : null; | 303 return stackTrace[i].scriptId ? stackTrace[i] : null; |
| 304 } | 304 } |
| 305 return callFrame; | 305 return callFrame; |
| 306 }, | 306 }, |
| 307 | 307 |
| 308 /** | 308 /** |
| 309 * @return {boolean} | 309 * @return {boolean} |
| 310 */ | 310 */ |
| 311 isErrorOrWarning: function() | 311 isErrorOrWarning: function() |
| 312 { | 312 { |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 return; | 1056 return; |
| 1057 | 1057 |
| 1058 for (var i = 0; i < stackTrace.length; i++) { | 1058 for (var i = 0; i < stackTrace.length; i++) { |
| 1059 var frame = stackTrace[i]; | 1059 var frame = stackTrace[i]; |
| 1060 | 1060 |
| 1061 var content = document.createElementWithClass("div", "stacktrace
-entry"); | 1061 var content = document.createElementWithClass("div", "stacktrace
-entry"); |
| 1062 var functionName = frame.functionName || WebInspector.UIString("
(anonymous function)"); | 1062 var functionName = frame.functionName || WebInspector.UIString("
(anonymous function)"); |
| 1063 content.createChild("span", "console-message-text source-code").
textContent = functionName; | 1063 content.createChild("span", "console-message-text source-code").
textContent = functionName; |
| 1064 | 1064 |
| 1065 if (frame.scriptId) { | 1065 if (frame.scriptId) { |
| 1066 content.createTextChild(" "); | |
| 1067 var urlElement = this._linkifyCallFrame(frame); | 1066 var urlElement = this._linkifyCallFrame(frame); |
| 1068 if (!urlElement) | 1067 if (!urlElement) |
| 1069 continue; | 1068 continue; |
| 1069 content.createTextChild(" "); |
| 1070 content.appendChild(urlElement); | 1070 content.appendChild(urlElement); |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 parentTreeElement.appendChild(new TreeElement(content)); | 1073 parentTreeElement.appendChild(new TreeElement(content)); |
| 1074 } | 1074 } |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 appendStackTrace.call(this, this._message.stackTrace); | 1077 appendStackTrace.call(this, this._message.stackTrace); |
| 1078 | 1078 |
| 1079 for (var asyncTrace = this._message.asyncStackTrace; asyncTrace; asyncTr
ace = asyncTrace.asyncStackTrace) { | 1079 for (var asyncTrace = this._message.asyncStackTrace; asyncTrace; asyncTr
ace = asyncTrace.asyncStackTrace) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 { | 1258 { |
| 1259 if (!this._wrapperElement) { | 1259 if (!this._wrapperElement) { |
| 1260 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this
); | 1260 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this
); |
| 1261 this._wrapperElement.classList.toggle("collapsed", this._collapsed); | 1261 this._wrapperElement.classList.toggle("collapsed", this._collapsed); |
| 1262 } | 1262 } |
| 1263 return this._wrapperElement; | 1263 return this._wrapperElement; |
| 1264 }, | 1264 }, |
| 1265 | 1265 |
| 1266 __proto__: WebInspector.ConsoleViewMessage.prototype | 1266 __proto__: WebInspector.ConsoleViewMessage.prototype |
| 1267 } | 1267 } |
| OLD | NEW |