Created attachment 320822 [details] [diff] [review] shows JS_GetPendingException I was trying to throw custom objects instead of Error objects and noticed that JS_GetPendingException doesn't return those. Here is a session in a slightly modified js shell. js> throw new Error() JS_GetPendingException: 1 typein:1: js> throw new Object() JS_GetPendingException: 0 uncaught exception: [object Object] js> shaver says this might be a bad bug.
We explicitly clear the exception before calling the error reporter for uncaught exceptions, I suspect in case the reporter calls script: http://lxr.mozilla.org/mozilla/source/js/src/jsexn.c#1293 Set JSOPTION_DONT_REPORT_UNCAUGHT on the context if you don't want the conversion to error. (Whew!)
Or not. We should SetPending/ClearPending around both flavours of error-reporter calling.