| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 DOM: "DOM", | 91 DOM: "DOM", |
| 92 EventListener: "EventListener", | 92 EventListener: "EventListener", |
| 93 XHR: "XHR", | 93 XHR: "XHR", |
| 94 Exception: "exception", | 94 Exception: "exception", |
| 95 PromiseRejection: "promiseRejection", | 95 PromiseRejection: "promiseRejection", |
| 96 Assert: "assert", | 96 Assert: "assert", |
| 97 DebugCommand: "debugCommand", | 97 DebugCommand: "debugCommand", |
| 98 Other: "other" | 98 Other: "other" |
| 99 } | 99 } |
| 100 | 100 |
| 101 /** | |
| 102 * @param {number=} value | |
| 103 * @return {number} | |
| 104 */ | |
| 105 WebInspector.DebuggerModel.fromOneBased = function(value) | |
| 106 { | |
| 107 // FIXME(webkit:62725): console stack trace line/column numbers are one-base
d. | |
| 108 return value ? value - 1 : 0; | |
| 109 } | |
| 110 | |
| 111 WebInspector.DebuggerModel.prototype = { | 101 WebInspector.DebuggerModel.prototype = { |
| 112 /** | 102 /** |
| 113 * @return {boolean} | 103 * @return {boolean} |
| 114 */ | 104 */ |
| 115 debuggerEnabled: function() | 105 debuggerEnabled: function() |
| 116 { | 106 { |
| 117 return !!this._debuggerEnabled; | 107 return !!this._debuggerEnabled; |
| 118 }, | 108 }, |
| 119 | 109 |
| 120 /** | 110 /** |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 { | 564 { |
| 575 var frames = []; | 565 var frames = []; |
| 576 while (stackTrace) { | 566 while (stackTrace) { |
| 577 for (var frame of stackTrace.callFrames) | 567 for (var frame of stackTrace.callFrames) |
| 578 frames.push(frame); | 568 frames.push(frame); |
| 579 stackTrace = stackTrace.parent; | 569 stackTrace = stackTrace.parent; |
| 580 } | 570 } |
| 581 | 571 |
| 582 var rawLocations = []; | 572 var rawLocations = []; |
| 583 for (var frame of frames) { | 573 for (var frame of frames) { |
| 584 var rawLocation = this.createRawLocationByScriptId(frame.scriptId, W
ebInspector.DebuggerModel.fromOneBased(frame.lineNumber), WebInspector.DebuggerM
odel.fromOneBased(frame.columnNumber)); | 574 var rawLocation = this.createRawLocationByScriptId(frame.scriptId, f
rame.lineNumber, frame.columnNumber); |
| 585 if (rawLocation) | 575 if (rawLocation) |
| 586 rawLocations.push(rawLocation); | 576 rawLocations.push(rawLocation); |
| 587 } | 577 } |
| 588 return rawLocations; | 578 return rawLocations; |
| 589 }, | 579 }, |
| 590 | 580 |
| 591 /** | 581 /** |
| 592 * @return {boolean} | 582 * @return {boolean} |
| 593 */ | 583 */ |
| 594 isPaused: function() | 584 isPaused: function() |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 /** | 1273 /** |
| 1284 * @param {?WebInspector.Target} target | 1274 * @param {?WebInspector.Target} target |
| 1285 * @return {?WebInspector.DebuggerModel} | 1275 * @return {?WebInspector.DebuggerModel} |
| 1286 */ | 1276 */ |
| 1287 WebInspector.DebuggerModel.fromTarget = function(target) | 1277 WebInspector.DebuggerModel.fromTarget = function(target) |
| 1288 { | 1278 { |
| 1289 if (!target || !target.hasJSContext()) | 1279 if (!target || !target.hasJSContext()) |
| 1290 return null; | 1280 return null; |
| 1291 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); | 1281 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); |
| 1292 } | 1282 } |
| OLD | NEW |