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 727787 - Should pay attention to GI list-type annotations for properties
Should pay attention to GI list-type annotations for properties
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
1.40.x
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-07 22:54 UTC by Philip Chimento
Modified: 2018-01-27 11:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Chimento 2014-04-07 22:54:40 UTC
As described in this doc page: https://wiki.gnome.org/action/show/Projects/GObjectIntrospection/Annotations?action=show&redirect=GObjectIntrospection%2FAnnotations

One should be able to define GList-typed GObject properties using g_param_spec_pointer() and the (type GList(SomeObject)) annotation. This works with GObject Introspection 1.40 but not with GJS.

Here's a gist containing a sample FooBar project to illustrate the problem: https://gist.github.com/ptomato/10070608

The generated .gir seems to be correct:

<property name="empty-list" transfer-ownership="none">
  <doc xml:space="preserve">Empty list with no #GObject objects inside.</doc>
  <type name="GLib.List" c:type="gpointer">
    <type name="GObject.Object"/>
  </type>
</property>
<property name="full-list" transfer-ownership="none">
  <doc xml:space="preserve">List with some #GObject objects inside.</doc>
  <type name="GLib.List" c:type="gpointer">
    <type name="GObject.Object"/>
  </type>
</property>

However, running the attached test.js after make install does the wrong thing:

Empty list property:
null
Empty list getter function:
[  ]
Full list property:
Error: Can't convert non-null pointer to JS value
Full list getter function:
[ [object instance proxy GIName:GObject.Object jsobj@0xb460ace0 native@0x8721b00],[object instance proxy GIName:GObject.Object jsobj@0xb460ad00 native@0x8721b20],[object instance proxy GIName:GObject.Object jsobj@0xb460ad20 native@0x8721b40] ]
Comment 1 Jasper St. Pierre (not reading bugmail) 2014-04-07 23:56:12 UTC
It's not possible for us to store raw pointers.
Comment 2 Cosimo Cecchi 2014-04-08 00:23:55 UTC
gobject-introspection already knows that those are not raw pointers though, since the annotation will manually propagate down the actual GType...
Comment 3 GNOME Infrastructure Team 2018-01-27 11:56:23 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/83.