(range, lines)
| 626 | } |
| 627 | |
| 628 | function mapRangeToLines(range, lines) { |
| 629 | const { startOffset, endOffset, count } = range; |
| 630 | const mappedLines = []; |
| 631 | let ignoredLines = 0; |
| 632 | let start = 0; |
| 633 | let end = lines.length; |
| 634 | let mid; |
| 635 | |
| 636 | while (start <= end) { |
| 637 | mid = MathFloor((start + end) / 2); |
| 638 | let line = lines[mid]; |
| 639 | |
| 640 | if (startOffset >= line?.startOffset && startOffset <= line?.endOffset) { |
| 641 | while (endOffset > line?.startOffset) { |
| 642 | // If the range is not covered, and the range covers the entire line, |
| 643 | // then mark that line as not covered. |
| 644 | if (startOffset <= line.startOffset && endOffset >= line.endOffset) { |
| 645 | line.count = count; |
| 646 | } |
| 647 | |
| 648 | ArrayPrototypePush(mappedLines, line); |
| 649 | |
| 650 | if (line.ignore) { |
| 651 | ignoredLines++; |
| 652 | } |
| 653 | |
| 654 | mid++; |
| 655 | line = lines[mid]; |
| 656 | } |
| 657 | |
| 658 | break; |
| 659 | } else if (startOffset >= line?.endOffset) { |
| 660 | start = mid + 1; |
| 661 | } else { |
| 662 | end = mid - 1; |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | return { __proto__: null, lines: mappedLines, ignoredLines }; |
| 667 | } |
| 668 | |
| 669 | function mergeCoverageScripts(oldScript, newScript) { |
| 670 | // Merge the functions from the new coverage into the functions from the |
no outgoing calls
no test coverage detected
searching dependent graphs…