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);
