What's that exception you have here?
Mike Harder found this one that I didn't know about: all exceptions that you may get from the browser are not Error instances. DOMException is an exception that gets thrown when a DOM operation fails, but for some incomprehensible reason it doesn't derive from Error like SyntaxError or TypeError:
try{ document.createElement(' '); } catch (ex){ alert(ex instanceof Error); }
This will alert false.
But wait, that's not all. There are other exceptions that derive from DOMException, so in order to handle that exception, you'd want to be able to know if an exception derives from it, something like that:
try{ document.createElement(' '); } catch (ex){ if (ex instanceof DOMException){ // Do stuff } }
Well, if you try that on Opera, you'll get a TypeError stating "DOMException does not implement [[HasInstance]]". Isn't that just awesome?