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 708920 - GObject: fix accessor properties on GObject classes
GObject: fix accessor properties on GObject classes
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-09-27 12:31 UTC by Giovanni Campagna
Modified: 2013-10-21 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GObject: fix accessor properties on GObject classes (2.45 KB, patch)
2013-09-27 12:31 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-09-27 12:31:55 UTC
We must not access this.prototype blindly, because a property
there might be an accessor that relies on some external state
we don't have on prototypes. Instead, access the property descriptor,
like Lang.Class does.
Comment 1 Giovanni Campagna 2013-09-27 12:31:57 UTC
Created attachment 255923 [details] [review]
GObject: fix accessor properties on GObject classes
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-09-27 16:38:34 UTC
What exactly is this fixing?
Comment 3 Giovanni Campagna 2013-09-27 21:21:34 UTC
Say you have a GObject class, and say this class has accessor properties (implementing GObject properties). If the getter for one of this properties cannot be called before the class is initialized (for example it does "return this._someObject.someProperty", which fails if this._someObject is not an object), then the program crashes at startup.
Comment 4 Colin Walters 2013-10-15 22:18:20 UTC
Review of attachment 255923 [details] [review]:

Makes sense, thanks!
Comment 5 Giovanni Campagna 2013-10-21 19:26:22 UTC
Attachment 255923 [details] pushed as 48b6933 - GObject: fix accessor properties on GObject classes