GNOME Bugzilla – Bug 751146
coverage: Don't warn about executing odd lines by default anymore
Last modified: 2017-01-06 07:33:16 UTC
Created attachment 305538 [details] [review] coverage: Suppress warnings about executing odd lines by default. We use some internal Reflect machinery in order to detect executable lines in a file. This agrees with the JS engine most of the time, but there will be times when it won't quite align. In most testing, I've found that the remaining cases where it doesn't aren't really cases that matter. For instance, we don't mark lines like the following as executable: function f(a, b) { There are some cases where execution might start on the line afterwards and some cases where execution might start on the function definition itself. In any case, we don't care - we only care about the code inside the function. The default behavior so far has been to warn when this happens and just count the line as executed. Now that we've caught most of the legitimately bad cases, I propose turning the warning off, as the rest is just noise. The code for the warnings is still there and can be turned on with GJS_DEBUG_COVERAGE_UNEXECUTED_LINES
Created attachment 305539 [details] [review] coverage: Add a testcase to be sure that strings inside case statements don't change the default executing behavior
Review of attachment 305539 [details] [review]: OK
Review of attachment 305538 [details] [review]: ::: modules/coverage.js @@ +742,3 @@ * It isn't poissible to unit test this class because it depends on running * Debugger which in turn depends on objects injected in from another compartment */ +function CoverageStatistics(prefixes, cache, suppress_warnings) { I think this parameter is called the wrong way, as it will have the effect of not suppressing the warnings.
Comment on attachment 305539 [details] [review] coverage: Add a testcase to be sure that strings inside case statements don't change the default executing behavior This was already committed as part of some other patch, apparently.
Fixed up the parameter name and pushed.