[Webkit-unassigned] [Bug 215877] [GTK] No way to determine if an exception has been thrown calling jsc_value_object_invoke_methodv

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 27 03:20:38 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=215877

Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cgarcia at igalia.com

--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Exceptions are handled a bit different in the GLib JSC API compared to other GLib based APIs. JavaScript APIs can change whether they can throw exceptions or not, without affecting the API, but in C, adding or removing GError parameter would be an API change. So, exceptions are handled by the JSCContext that keeps a reference to the latest exception being thrown. This is similar to other APIS like cairo or OpenGL. To handle the exceptions you can either check jsc_context_get_exception() after an API call and handle it by clearing it, or you can push your own handler with jsc_context_push_exception_handler(). Until the handler is popped with jsc_context_pop_exception_handler(), the callback given to the push will be called every time an expcetion is handled. Inside the callback you can handle the exception or throw it by calling jsc_context_throw_exception().

So, if after calling jsc_value_object_invoke_methodv(), and the method invocation causes and exception, jsc_context_get_exception() returns null, the this is indeed a bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200827/640922a2/attachment-0001.htm>


More information about the webkit-unassigned mailing list