GNOME Bugzilla – Bug 615932
Error: No exception was set, but object construction failed somehow
Last modified: 2018-01-27 11:43:40 UTC
Not sure what's going on here. Looking for some guidance. <method name="group_get_members" c:identifier="tp_channel_group_get_members"> <return-value transfer-ownership="none"> <type name="IntSet" c:type="TpIntSet*"/> </return-value> </method> <record name="IntSet" c:type="TpIntSet" doc="Opaque type representing a set of unsigned integers."> </record> JS G OBJ: Defining method group_get_members in prototype for TpChannel (TelepathyGLib.Channel) JS G NS: Found info type STRUCT for 'IntSet' in namespace 'TelepathyGLib' JS G NS: Found info type STRUCT for 'IntSet' in namespace 'TelepathyGLib' JS G REPO: Initializing dynamic class IntSet 0x86dc640 JS G BXD: Defined class IntSet prototype is 0x86cd940 class 0x86dc640 in object 0x869d900 Error: No exception was set, but object construction failed somehow
Tried defining IntSet as a boxed type? Last time I tried, we were not supporting struct constructors. I guess you're trying to do something like "new TpIntSet"?
Boxed type was my guess as well, but it's a return value in the gir and looking at the testEverythingEncapsulated.js gjs test we should be supporting structs. Though the test isn't testing return value...
I had a similar problem with returned structs when trying to use gdk_pixbuf_get_formats() which returns a list of GdkPixbufFormat. Making GdkPixbufFormat a boxed type fixed it.
I was calling channel.group_get_members(). We could probably register a boxed type for TpIntSet.
Note that whether or not it represents a problem with a usage (trying to return a struct by reference that isn't registered as a boxed type is a bug, since there will be no way for Gjs to know how to free it...), the error message you got represents a bug in Gjs that needs to be tracked down and fixed, or other people will also have no idea what is going on.
In boxed.c:boxed_new(), it looks like this JS_FALSE doesn't throw an exception: if (JSVAL_IS_NULL(rval)) return JS_FALSE; this is if the constructor returns NULL I guess. Maybe a different bug from what you're seeing.
Yep, registering a boxed type works. Thanks.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/46.