(offset: number)
| 43 | } |
| 44 | |
| 45 | getLinecol(offset: number): [line: number, col: number] { |
| 46 | offset = Math.max(Math.min(offset, this.source.length), 0); |
| 47 | |
| 48 | const lineOffsets = this.lineOffsets; |
| 49 | let low = 0; |
| 50 | let high = lineOffsets.length; |
| 51 | if (high === 0) return [1, offset + 1]; |
| 52 | while (low < high) { |
| 53 | const mid = Math.floor((low + high) / 2); |
| 54 | if (lineOffsets[mid] > offset) high = mid; |
| 55 | else low = mid + 1; |
| 56 | } |
| 57 | return [low, offset - lineOffsets[low - 1] + 1]; |
| 58 | } |
| 59 | |
| 60 | signalOrigin(offset: number): SignalOrigin { |
| 61 | const [line, column] = this.getLinecol(offset); |
no test coverage detected