GNOME Bugzilla – Bug 743007
Coverage counters can't handle files without trailing newlines properly
Last modified: 2015-01-17 01:00:01 UTC
Created attachment 294643 [details] [review] Allocate nLines + 1 Amazingly, its been a while until we ran into this issue. The output from gjs is (gjs:10925): Gjs-WARNING **: JS REPORTED: [resource:///org/gnome/gjs/modules/coverage.js 571]: Error: Executed line 63 which was past the highest-found line. The problem is that we use 1-indexing for things and allocate an array the size of nLines. This works, so long as there's an empty line which would have never been executed on the end of the script, but a trailing newline is not required for a script to be valid. We need to handle that case. Some tests also assume that the array produced is nLines length and not nLines + 1, so they need to be adjusted too.
Review of attachment 294643 [details] [review]: OK.