Index: jscoverage.js =================================================================== --- jscoverage.js (revision 431) +++ jscoverage.js (working copy) @@ -1,6 +1,6 @@ /* jscoverage.js - code coverage for JavaScript - Copyright (C) 2007, 2008, 2009 siliconforks.com + Copyright (C) 2007, 2008 siliconforks.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -522,6 +522,28 @@ cell.appendChild(document.createTextNode(", ")); } link = jscoverage_createLink(file, missing[i]); + var j, start=missing[i]; + do{ + j=1; + while (i+j=length){ + break; + } + i=i+j; + }while(true); + if(start!=missing[i]){ + link.innerHTML += "-" + missing[i+j-1]; + i += j-1; + } cell.appendChild(link); } row.appendChild(cell); @@ -545,7 +567,7 @@ tds[1].firstChild.nodeValue = totals['statements']; tds[2].firstChild.nodeValue = totals['executed']; - var coverage = parseInt(totals['coverage'] / ( totals['files'] - totals['skipped'] ) ); + var coverage = parseInt(totals['executed'] / totals['statements'] * 100 ); if( isNaN( coverage ) ) { coverage = 0; }