github at esdiscuss.org (2013-07-12T02:26:27.645Z)
>> Talking about 100% coverage and "catching all errors" is never a
>> good combination - even if you should have found an example of
>> where this works, it will be an exception.
>
> There are a couple of things I'm sure of. For instance, direct eval
> aside (eval needs some specific work anyway because its semantics is
> changed a lot), if you have 100% coverage, every instance of setting to
> an undeclared variable will be caught. There is no exception.
Out of curiosity, what does your favorite test coverage tool report
for the source below? And what does it report when you comment
out the directive?
```js
function test(force) {
"use strict";
function isStrict() { return !this }
console.log(isStrict());
if (!force && (!isStrict() && (doocument="unndefined"))) {
console.log("we don't have lift-off");
} else {
console.log("ready to go!");
// do stuff
}
!isStrict() && console.log(doocument);
}
test(false);
test(true);
```
>> Talking about 100% coverage and "catching all errors" is never a >> good combination - even if you should have found an example of >> where this works, it will be an exception. > There are a couple of things I'm sure of. For instance, direct eval > aside (eval needs some specific work anyway because its semantics is > changed a lot), if you have 100% coverage, every instance of setting to > an undeclared variable will be caught. There is no exception. Out of curiosity, what does your favorite test coverage tool report for the source below? And what does it report when you comment out the directive? Claus ---------------- function test(force) { "use strict"; function isStrict() { return !this } console.log(isStrict()); if (!force && (!isStrict() && (doocument="unndefined"))) { console.log("we don't have lift-off"); } else { console.log("ready to go!"); // do stuff } !isStrict() && console.log(doocument); } test(false); test(true);