GNOME Bugzilla – Bug 786183
A few fixes for stack traces and error reporting
Last modified: 2017-08-13 23:39:41 UTC
Here are a few patches in the general area of stack traces and exception reporting.
Created attachment 357451 [details] [review] gerror: Use JS::CaptureCurrentStack for stack info This uses the new facilities available in JSAPI to define the standard JS Error properties on GError-marshalled exceptions, rather than the workaround of creating a new Error object and reading its properties that was previously used in gjs_context_get_frame_info().
Created attachment 357452 [details] [review] stack: Remove gjs_context_get_frame_info() This is not needed anymore as we can now use the new facilities in JSAPI for getting frame info, and use gjs_format_stack_trace() to build the actual stack string.
Created attachment 357453 [details] [review] gerror: Define a columnNumber on GError-backed errors Newer JS defines a columnNumber property on Error objects, so our GError-backed ones should have this property as well.
Created attachment 357454 [details] [review] console: Print exception even when not from SpiderMonkey This was a recent regression; the console shell would abort if an exception couldn't be converted into an error report. However, only exceptions created within SpiderMonkey have error reports associated with them. Our exceptions created from GErrors do not, so if there is no error report available simply convert the exception to a string.
Review of attachment 357451 [details] [review]: OK
Review of attachment 357452 [details] [review]: OK
Review of attachment 357453 [details] [review]: ++
Review of attachment 357454 [details] [review]: OK
Attachment 357451 [details] pushed as 12ff7d1 - gerror: Use JS::CaptureCurrentStack for stack info Attachment 357452 [details] pushed as f2aa7cb - stack: Remove gjs_context_get_frame_info() Attachment 357453 [details] pushed as 1ca6342 - gerror: Define a columnNumber on GError-backed errors Attachment 357454 [details] pushed as 29ff8b8 - console: Print exception even when not from SpiderMonkey