Skip to content
  • Philip Chimento's avatar
    GObject: Allow omitting setters and getters · 962471c5
    Philip Chimento authored
    In the case where you don't need anything special from your GObject
    property getters and setters, just correct handling of notify signals
    and default values, it's now possible to leave out the getters and
    setters, and GJS will just do the right thing. This is convenient for
    JS code authors as well as avoiding problems caused by missing getters
    and setters.
    
    This only works for read-write properties. If a read-only or write-only
    property is missing its accessor, then one is generated which throws.
    
    If the property name consists of multiple words, then accessors will be
    generated for all three variants: kebab-case, snake_case, and camelCase.
    Additionally, if you do provide accessors for one of these, then they
    will be copied to the other two variants.
    
    See: #306
    962471c5