(message: string)
| 151 | } |
| 152 | |
| 153 | private error(message: string) { |
| 154 | const text = this.text |
| 155 | const pos = this.pos |
| 156 | const start = Math.max(pos - 12, 0) |
| 157 | const end = Math.min(pos + 12, text.length) |
| 158 | const prefix = start > 0 ? "..." : "" |
| 159 | const suffix = end < text.length ? "..." : "" |
| 160 | const context = `"${prefix}${text.substring( |
| 161 | start, |
| 162 | pos, |
| 163 | )} -> ${text.substring(pos, end)}${suffix}"` |
| 164 | |
| 165 | return new Error(`${message} at ${context}`) |
| 166 | } |
| 167 | } |
no outgoing calls
no test coverage detected