Ecmascript use of window.onerror
<p>So I'm trying to wrap my head around something I just read in "professional Javascript", by <em>Nicholas Zakas</em>: It gives the following code as an example:</p>

<pre><code>window.onerror = function(message, url, line){
alert(message);
return false;
};
</code></pre>

<p>and then says: "By returning false, this function effectively becomes a try-catch statement for the entire document, capturing all unhandled runtime errors. This event handler is the <strong>last line of defense</strong> against errors being reported by the browser.."</p>

<p>So my question is, will this piece of code prevent the execution of your script from stopping, with any error it encounters? or are there any errors that will still stop execution? thanks.</p>

<hr>

<p>edit: maybe a better question would be, why is this not a good method for preventing a script from stopping its execution when it hits an error..</p>
