object: Add GObject properties to the correct prototype

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:

         |                |
  GCharsetConverter   Subclass2

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
parent 8ea9cff7
Pipeline #18818 passed with stages
in 8 minutes and 15 seconds