(
location: Cdp.Runtime.CallFrame | Cdp.Debugger.CallFrame | Cdp.Debugger.Location,
)
| 728 | } |
| 729 | |
| 730 | rawLocation( |
| 731 | location: Cdp.Runtime.CallFrame | Cdp.Debugger.CallFrame | Cdp.Debugger.Location, |
| 732 | ): RawLocation { |
| 733 | // Note: cdp locations are 0-based, while ui locations are 1-based. Also, |
| 734 | // some we can *apparently* get negative locations; Vue's "hello world" |
| 735 | // project was observed to emit source locations at (-1, -1) in its callframe. |
| 736 | if ('location' in location) { |
| 737 | const loc = location as Cdp.Debugger.CallFrame; |
| 738 | return { |
| 739 | url: loc.url, |
| 740 | lineNumber: Math.max(0, loc.location.lineNumber) + 1, |
| 741 | columnNumber: Math.max(0, loc.location.columnNumber || 0) + 1, |
| 742 | scriptId: loc.location.scriptId, |
| 743 | }; |
| 744 | } |
| 745 | return { |
| 746 | url: (location as Cdp.Runtime.CallFrame).url || '', |
| 747 | lineNumber: Math.max(0, location.lineNumber) + 1, |
| 748 | columnNumber: Math.max(0, location.columnNumber || 0) + 1, |
| 749 | scriptId: location.scriptId, |
| 750 | }; |
| 751 | } |
| 752 | |
| 753 | public async rawLocationToUiLocation( |
| 754 | rawLocation: RawLocation, |
no outgoing calls
no test coverage detected