The end.column may be out of range when wrapperLength is applied to empty coverage reports. E.g. "end": { "line": 7, "column": -229 }
The empty coverage reports are typically (always?) manually generated. Utilizers read the raw sources from file system and create fake V8 reports for these uncovered files. Example from c8:
When the utilizers have a shared wrapperLength that they apply to all V8 reports, the empty coverage ones may be invalid as they did not contain the expected wrapper around source codes. This bug comes up especially in c8 but the fixed could be set here in upstream so that other utilizers wouldn't have to do same checks. @bcoe any thoughts - should this be instead in c8 only?
The fix should not cause any conflicts even if some utilizer is already taking this into consideration.
Description
The
end.column
may be out of range whenwrapperLength
is applied to empty coverage reports. E.g."end": { "line": 7, "column": -229 }
The empty coverage reports are typically (always?) manually generated. Utilizers read the raw sources from file system and create fake V8 reports for these uncovered files. Example from
c8
:https://github.com/bcoe/c8/blob/2f36fe9d00bf2f3b869ce890ed11416304c903fe/lib/report.js#L203-L220
When the utilizers have a shared
wrapperLength
that they apply to all V8 reports, the empty coverage ones may be invalid as they did not contain the expected wrapper around source codes. This bug comes up especially inc8
but the fixed could be set here in upstream so that other utilizers wouldn't have to do same checks. @bcoe any thoughts - should this be instead inc8
only?The fix should not cause any conflicts even if some utilizer is already taking this into consideration.
Minimal reproduction