diff --git a/lib/converter/converter.js b/lib/converter/converter.js index 3e6e4135..d2bd919e 100644 --- a/lib/converter/converter.js +++ b/lib/converter/converter.js @@ -1239,15 +1239,17 @@ const initJsCoverageList = (item) => { inUncoveredRange.coveredList.push(range); } } - } else { - if (count === 0) { - uncoveredBlocks.push({ - ... range, - index: i, - ranges: block.ranges - }); - } + return; } + + if (count === 0) { + uncoveredBlocks.push({ + ... range, + index: i, + ranges: block.ranges + }); + } + }); }); @@ -1283,7 +1285,7 @@ const initJsCoverageList = (item) => { }); } - ranges.splice.apply(ranges, args); + ranges.splice(... args); }); } diff --git a/lib/platform/share.js b/lib/platform/share.js index c7322f83..958ebe11 100644 --- a/lib/platform/share.js +++ b/lib/platform/share.js @@ -347,12 +347,13 @@ const Util = { // 2, uncovered entire and pieces if (count > 0) { lineItem.coveredCount = Math.max(lineItem.coveredCount, count); + return; + } + + if (it.entire) { + lineItem.uncoveredEntire = it; } else { - if (it.entire) { - lineItem.uncoveredEntire = it; - } else { - lineItem.uncoveredPieces.push(it); - } + lineItem.uncoveredPieces.push(it); } });