• Georges Basile Stavracas Neto's avatar
    object: Add GObject properties to the correct prototype · f6758a3c
    Georges Basile Stavracas Neto authored
    Whenever successfully resolving a property, GJS is mistakenly setting
    the property in the prototype of the prototype, instead of just the
    prototype. When that happens, it ends up breaking any properties of
    subclasses. Suppose the following scenario:
    
          GObject
             |________________
             |                |
      GCharsetConverter   Subclass2
             |
         Subclass1
    
    In this scenario, if 'Subclass1' accesses any possible property from
    GCharsetConverter, GJS resolves that but ends up setting this property
    in the prototype of the prototype.
    
    If 'Subclass2' then tries to subsequently access that property, the
    resolving process will accidentally call the wrong getter. This leads
    to an immediate crash.
    
    Fix that by using the correct object prototype when resolving the
    properties. A reproducer was added to the test suite in addition to
    the fix to this problem, as a protective measure.
    
    Fixes #171
    f6758a3c
Name
Last commit
Last update
..
arg.cpp Loading commit data...
arg.h Loading commit data...
boxed.cpp Loading commit data...
boxed.h Loading commit data...
closure.cpp Loading commit data...
closure.h Loading commit data...
enumeration.cpp Loading commit data...
enumeration.h Loading commit data...
foreign.cpp Loading commit data...
foreign.h Loading commit data...
function.cpp Loading commit data...
function.h Loading commit data...
fundamental.cpp Loading commit data...
fundamental.h Loading commit data...
gerror.cpp Loading commit data...
gerror.h Loading commit data...
gjs_gi_probes.d Loading commit data...
gjs_gi_trace.h Loading commit data...
gobject.cpp Loading commit data...
gobject.h Loading commit data...
gtype.cpp Loading commit data...
gtype.h Loading commit data...
interface.cpp Loading commit data...
interface.h Loading commit data...
ns.cpp Loading commit data...
ns.h Loading commit data...
object.cpp Loading commit data...
object.h Loading commit data...
param.cpp Loading commit data...
param.h Loading commit data...
private.cpp Loading commit data...
private.h Loading commit data...
proxyutils.cpp Loading commit data...
proxyutils.h Loading commit data...
repo.cpp Loading commit data...
repo.h Loading commit data...
toggle.cpp Loading commit data...
toggle.h Loading commit data...
union.cpp Loading commit data...
union.h Loading commit data...
value.cpp Loading commit data...
value.h Loading commit data...