Ticket #742 (new task)
Handle JS errors properly
|Reported by:||Philip||Owned by:|
|Priority:||Nice to Have||Milestone:||Backlog|
Our current handling of SpiderMonkey errors is all broken: mostly we assume they don't happen, and if they do we report an error but don't propagate the exception. I've not noticed this being a significant problem in practice, but it's not nice.
I believe the way it's meant to work is (as here):
- If a JSAPI function returns JS_FALSE, it has reported an error and thrown an exception; either propagate JS_FALSE back into JSAPI, or use JS_ClearPendingException to catch it.
- To trigger a JSAPI error, use JS_ReportError and return JS_FALSE.