diff options
Diffstat (limited to 'node_modules/istanbul-reports/lib')
-rw-r--r-- | node_modules/istanbul-reports/lib/html/annotator.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/node_modules/istanbul-reports/lib/html/annotator.js b/node_modules/istanbul-reports/lib/html/annotator.js index 4909f30de..cb1f24e5a 100644 --- a/node_modules/istanbul-reports/lib/html/annotator.js +++ b/node_modules/istanbul-reports/lib/html/annotator.js @@ -57,13 +57,12 @@ function annotateStatements(fileCoverage, structuredText) { if (type === 'no' && structuredText[startLine]) { if (endLine !== startLine) { - endLine = startLine; endCol = structuredText[startLine].text.originalLength(); } text = structuredText[startLine].text; text.wrap(startCol, openSpan, - startLine === endLine ? endCol : text.originalLength(), + startCol < endCol ? endCol : text.originalLength(), closeSpan); } }); @@ -90,13 +89,12 @@ function annotateFunctions(fileCoverage, structuredText) { if (type === 'no' && structuredText[startLine]) { if (endLine !== startLine) { - endLine = startLine; endCol = structuredText[startLine].text.originalLength(); } text = structuredText[startLine].text; text.wrap(startCol, openSpan, - startLine === endLine ? endCol : text.originalLength(), + startCol < endCol ? endCol : text.originalLength(), closeSpan); } }); @@ -145,7 +143,6 @@ function annotateBranches(fileCoverage, structuredText) { if (count === 0 && structuredText[startLine]) { //skip branches taken if (endLine !== startLine) { - endLine = startLine; endCol = structuredText[startLine].text.originalLength(); } text = structuredText[startLine].text; @@ -159,7 +156,7 @@ function annotateBranches(fileCoverage, structuredText) { } else { text.wrap(startCol, openSpan, - startLine === endLine ? endCol : text.originalLength(), + startCol < endCol ? endCol : text.originalLength(), closeSpan); } } |