Closed zofrex closed 7 years ago
autoJSAPIOwnsErrorReporting
should definitely be true for Servo. Paging @bholley.
Yes. If you want to avoid an error reporting nightmare, Servo should do the following: 1: Set autoJSAPIOwnsErrorReporting and dontReportUncaught everywhere (hopefully on the single JSContext that Servo presumably has). 2: Register a "WarningOnlyErrorReporter", that behaves similarly to the one set by AutoJSAPI::TakeOwnershipOfErrorReporting. 3: Implementing an RAII class like AutoJSAPI, which handles errors when it gets popped off the stack.
How can I enable error reporting on current rust-mozjs version....
SpiderMonkey no longer calls a callback to report errors, just warnings (SetWarningReporter
). You'll need to handle errors yourself when appropriate; there's some code in Servo you might be able to reuse.
Out of the box, the registered error reporting function is not being called for me. I've narrowed it down to these two lines in Runtime::new():
Unless both of these options are set to false, the error reporting function doesn't get called on error.