(content)
| 258 | // from. This allows translation from byte offset V8 coverage reports, |
| 259 | // to line/column offset Source Map V3. |
| 260 | function lineLengths(content) { |
| 261 | const contentLength = content.length; |
| 262 | const output = []; |
| 263 | let lineLength = 0; |
| 264 | for (let i = 0; i < contentLength; i++, lineLength++) { |
| 265 | const codePoint = StringPrototypeCodePointAt(content, i); |
| 266 | |
| 267 | // We purposefully keep \r as part of the line-length calculation, in |
| 268 | // cases where there is a \r\n separator, so that this can be taken into |
| 269 | // account in coverage calculations. |
| 270 | // codepoints for \n (new line), \u2028 (line separator) and \u2029 (paragraph separator) |
| 271 | if (codePoint === 10 || codePoint === 0x2028 || codePoint === 0x2029) { |
| 272 | ArrayPrototypePush(output, lineLength); |
| 273 | lineLength = -1; // To not count the matched codePoint such as \n character |
| 274 | } |
| 275 | } |
| 276 | ArrayPrototypePush(output, lineLength); |
| 277 | return output; |
| 278 | } |
| 279 | |
| 280 | /** |
| 281 | * Read source map from file. |
no outgoing calls
no test coverage detected
searching dependent graphs…