(sourceText, position, useColors)
| 152 | } |
| 153 | |
| 154 | function markSourceColumn(sourceText, position, useColors) { |
| 155 | if (!sourceText) return ''; |
| 156 | |
| 157 | const head = StringPrototypeSlice(sourceText, 0, position); |
| 158 | let tail = StringPrototypeSlice(sourceText, position); |
| 159 | |
| 160 | // Colourize char if stdout supports colours |
| 161 | if (useColors) { |
| 162 | tail = SideEffectFreeRegExpPrototypeSymbolReplace(/(.+?)([^\w]|$)/, tail, |
| 163 | '\u001b[32m$1\u001b[39m$2'); |
| 164 | } |
| 165 | |
| 166 | // Return source line with coloured char at `position` |
| 167 | return head + tail; |
| 168 | } |
| 169 | |
| 170 | function extractErrorMessage(stack) { |
| 171 | if (!stack) return '<unknown>'; |
no test coverage detected
searching dependent graphs…