| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * @param {!WebInspector.ConsoleMessage} message | 79 * @param {!WebInspector.ConsoleMessage} message |
| 80 * @return {?WebInspector.DebuggerModel.Location} | 80 * @return {?WebInspector.DebuggerModel.Location} |
| 81 */ | 81 */ |
| 82 _rawLocation: function(message) | 82 _rawLocation: function(message) |
| 83 { | 83 { |
| 84 var debuggerModel = WebInspector.DebuggerModel.fromTarget(message.target
()); | 84 var debuggerModel = WebInspector.DebuggerModel.fromTarget(message.target
()); |
| 85 if (!debuggerModel) | 85 if (!debuggerModel) |
| 86 return null; | 86 return null; |
| 87 var callFrame = message.stackTrace && message.stackTrace.callFrames ? me
ssage.stackTrace.callFrames[0] : null; |
| 87 // FIXME(62725): stack trace line/column numbers are one-based. | 88 // FIXME(62725): stack trace line/column numbers are one-based. |
| 88 var lineNumber = message.stackTrace ? message.stackTrace[0].lineNumber -
1 : message.line - 1; | 89 var lineNumber = callFrame ? callFrame.lineNumber - 1 : message.line - 1
; |
| 89 var columnNumber = message.column ? message.column - 1 : 0; | 90 var columnNumber = message.column ? message.column - 1 : 0; |
| 90 if (message.stackTrace && message.stackTrace[0].columnNumber) | 91 if (callFrame && callFrame.columnNumber) |
| 91 columnNumber = message.stackTrace[0].columnNumber - 1; | 92 columnNumber = callFrame.columnNumber - 1; |
| 92 if (message.scriptId) | 93 if (message.scriptId) |
| 93 return debuggerModel.createRawLocationByScriptId(message.scriptId, l
ineNumber, columnNumber); | 94 return debuggerModel.createRawLocationByScriptId(message.scriptId, l
ineNumber, columnNumber); |
| 94 return debuggerModel.createRawLocationByURL(message.url || "", lineNumbe
r, columnNumber); | 95 return debuggerModel.createRawLocationByURL(message.url || "", lineNumbe
r, columnNumber); |
| 95 }, | 96 }, |
| 96 | 97 |
| 97 /** | 98 /** |
| 98 * @param {!WebInspector.ConsoleMessage} message | 99 * @param {!WebInspector.ConsoleMessage} message |
| 99 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 100 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 100 */ | 101 */ |
| 101 _addConsoleMessageToScript: function(message, rawLocation) | 102 _addConsoleMessageToScript: function(message, rawLocation) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 dispose: function() | 185 dispose: function() |
| 185 { | 186 { |
| 186 this._liveLocation.dispose(); | 187 this._liveLocation.dispose(); |
| 187 if (this._uiMessage) | 188 if (this._uiMessage) |
| 188 this._uiMessage.remove(); | 189 this._uiMessage.remove(); |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 | 192 |
| 192 /** @type {!WebInspector.PresentationConsoleMessageHelper} */ | 193 /** @type {!WebInspector.PresentationConsoleMessageHelper} */ |
| 193 WebInspector.presentationConsoleMessageHelper; | 194 WebInspector.presentationConsoleMessageHelper; |
| OLD | NEW |