Skip to content

Commit

Permalink
chore: address code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Oct 11, 2019
1 parent 7ac2f3f commit 15994ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/internal/source_map/source_map_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ function dataFromUrl(basePath, sourceMappingURL) {
// from. This allows translation from byte offset V8 coverage reports,
// to line/column offset Source Map V3.
function lineLengths(content) {
return content.split('\n').map((line) => {
// We purposefully keep \r as part of the line-length calculation, in
// cases where there is a \r\n separator, so that this can be taken into
// account in coverage calculations.
return content.split(/\n|\u2028|\u2029/).map((line) => {
return line.length;
});
}
Expand Down

0 comments on commit 15994ab

Please sign in to comment.