[Update. I need to be more precise, I see...] See the following example in javascript:
<html>
<head>
<script>
window.onerror = function() {
alert('error'); // this one works
try {i.dont.exist += 0;}
catch(e) {
// do some stacktrace stuff, this does not trigger
alert(e.stack);
}
};
</script>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js' type='text/javascript'></script>
<script>
$(document).ready(function() {
foo[1]++;
});
</script>
</head>
<body>
<p>Hello world.</p>
</body>
</html>
The 2. alert is not triggered. Why? If I replace "foo[1]++" by "this is a bogus line" everything works and both alerts are triggered. Is there some run-time error problem?