Skip to content

Instantly share code, notes, and snippets.

@mattdangerw
Created May 14, 2014 02:39
Show Gist options
  • Save mattdangerw/a7981a88e5e572016730 to your computer and use it in GitHub Desktop.
Save mattdangerw/a7981a88e5e572016730 to your computer and use it in GitHub Desktop.
gjs property bug
const Lang = imports.lang;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const TestObject = new Lang.Class({
Name: 'TestObject',
Extends: GObject.Object,
Properties: {
'prop': GObject.ParamSpec.string('prop', '', '', GObject.ParamFlags.WRITABLE, '')
},
_init: function (props) {
this.parent(props);
},
set prop (v) {
print("here");
v = v.notathing.whyisthishappening;
throw new Error();
}
});
let test = new TestObject({
prop: "t"
});
// This code only matters because it calls bind property
Gtk.init(null);
let label = new Gtk.Label();
label.bind_property('label',
label, 'name',
GObject.BindingFlags.SYNC_CREATE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment