After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615932 - Error: No exception was set, but object construction failed somehow
Error: No exception was set, but object construction failed somehow
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2010-04-16 08:01 UTC by Danielle Madeley
Modified: 2018-01-27 11:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Danielle Madeley 2010-04-16 08:01:36 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
Comment 1 Lucas Rocha 2010-04-16 10:06:54 UTC
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"?
Comment 2 Tommi Komulainen 2010-04-16 10:39:11 UTC
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...
Comment 3 Lucas Rocha 2010-04-16 10:58:53 UTC
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.
Comment 4 Danielle Madeley 2010-04-16 11:24:37 UTC
I was calling channel.group_get_members().

We could probably register a boxed type for TpIntSet.
Comment 5 Owen Taylor 2010-04-16 13:49:45 UTC
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.
Comment 6 Havoc Pennington 2010-04-16 14:35:19 UTC
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.
Comment 7 Danielle Madeley 2010-04-16 23:34:24 UTC
Yep, registering a boxed type works. Thanks.
Comment 8 GNOME Infrastructure Team 2018-01-27 11:43:40 UTC
-- 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.