Skip to content

js: Fix constructor parameters

Florian Müllner requested to merge fmuellner/polari:construct-params into main

Commit 33368eba moved the initialization of properties that back GObject properties into fields, because in subclasses this only becomes available after chaining up with super().

However fields don't work in that case, because they are applied right before the super() call returns, which means they override the values that were passed to the GObject constructor.

In cases where we don't need any special handling in getters or setters, we can remove the backing variable altogether and rely on automatic accessors.

In other cases we can add the CONSTRUCT flag to force the setter to run with the default value.

In either case, we can get rid of the fields.

Merge request reports