The ECMA standard dictates that a compliant implementation will detect and alert on all errors in the code even if the error is in a section of code that is not executed. Such dead code might be in a conditional block for which the condition could never be true. Nevertheless, a compile time warning should be generated.
This means that you should not rely on placing code within an if(false) block to prevent its execution. Instead, you should comment out the code to achieve the same effect.
This behavior is generally implementation-dependent due to the different ways that compilers and interpreters may be designed and built. It also changes as browser versions evolve and of course the kind of error that is thrown can also affect when and how it is detected and managed.