Given the following:
var str = "apples"; try {eval(str)} catch(e) {document.write('BAD CODE: '+e.name + ': '+e.message)}
The code works fine, the error message prints correctly, but when it starts under Firebug, execution stops, and Firebug pops up and says "apples are not defined." THIS SHOULD NOT CONTINUE, since the error is enclosed in brackets in the try-catch macro.
Try-catch correctly catches other errors, such as TypeError and SyntaxError, and prevents them from appearing in Firebug. However, it does not block ReferenceError.
All other browsers correctly block ReferenceError.
Question: Why does the trap attempt not catch this error? Is this a real bug in Firebug?
source share