| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The accessors would be invoked while traversing the prototype for vfuncs.
|
|
|
|
|
|
|
|
|
|
|
| |
A Gio.DBusProxyClass is a Lang.Class and should behave like one,
including the _init handling. In particular, this allows for
"slim proxies", that can be created without passing parameters
(or with a subset of them).
This is implemented by moving the special initialization of DBusProxy
to an _init override, instead of hooking into init and init_async methods.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split asynchronous result collection into a MethodFinish function,
so that exceptions can be caught in the usual way instead of being
passed as objects to the functions. Also, remove the flags parameter
and make the cancellable argument compulsory, matching the code
generated by gdbus-codegen.
Finally, make proxy initialization explicit, reducing the amount
of magic done by the bindings.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
|
|
|
|
| |
Using the new metaclass system, introduce Gio.DBusProxyClass and
Gio.DBusImplementerClass, that allow declaring specialized proxies/
implementations for specific interfaces.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
|
|
|
|
| |
If JS_CStringsAreUTF8 is false, the JSAPI assumes C strings are
ISO-8859-1. Unfortunately, we rely on that setting for byte arrays,
so just do the conversion ourselves, like we do in gjs_context_eval().
https://bugzilla.gnome.org/show_bug.cgi?id=687095
|
|
|
|
|
|
|
|
|
|
|
| |
Stop creating multiple JS classes on demand, and instead use the
same JS class and create multiple constructors with different
prototypes, but hand-rolling our own version of JS_InitClass, that
also avoids polluting the global object.
This means that JS_ConstructObject is no longer usable with dynamic
classes, use gjs_construct_object_dynamic or JS_New instead.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
|
| |
JS_ConstructObject is deprecated with modern JSAPI, and should be
replaced by JS_NewObject and JS_New. Also, while we're there,
replace constructors with functions that throw, as it is generally
an error to call them from JS anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
| |
Not only that flag is removed in newer versions of libjs, it will
break with the new dynamic class system.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Many GObject (such as widgets and actors) don't have JS state, but
they're kept alive by C code. We can therefore save some memory
by GCing these objects, and creating new wrappers when needed.
If state is ever set, we transparently switch to toggle refs, so
no change should be visible at the JS level.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callbacks installed with GObject methods are now traced from that
object instead of being rooted, so cycles no longer cause leaks.
This implementing by making GjsCallbackTrampoline use GjsClosure
internally, and generalizing the existing code that dealt with
signal connections.
Also, to keep tests ok, we now have class finalization functions
for custom types (to unregister the closures).
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
|
|
| |
Adds a print_roots() to keep-alive objects (such as
__gc_this_on_context_destroy, where GObjects are stored), which
prints a dump of all objects known to it on stderr.
This is primarily meant to debug GObject cycles and leaks that
are not detected.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
| |
Spotted by valgrind.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
| |
g_type_query() only works with static types, so it fails when inheriting
from another JS class. Work around that by using the first static parent
for GJS custom type (as we never override the instance or class type)
https://bugzilla.gnome.org/show_bug.cgi?id=687184
|
|
|
|
| |
signal_name doesn't exist in scope, signalName does.
|
|
|
|
|
|
|
| |
Instead, use String() as a function. It fixes passing null or
undefined to format().
https://bugzilla.gnome.org/show_bug.cgi?id=687153
|
|
|
|
| |
See http://git.gnome.org/browse/glib/commit/?id=7c42ab23b55c43ab96d0ac2124b550bf1f49c1ec
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=685431
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=682290
|
| |
|
|
|
|
|
|
|
| |
We need to iterate the stack here at least once or the while
loop will terminate early.
https://bugzilla.gnome.org/show_bug.cgi?id=683992
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
In >=gobject-introspection-1.33.2, libffi was moved from Requires to
Requires.private. Since gjs directly uses ffi functions, a missing
PKG_CHECK_MODULES for libffi results in build failure when using GNU
gold as the linker.
https://bugzilla.gnome.org/show_bug.cgi?id=684064
|
|
|
|
|
|
|
| |
log must only be called with one argument. At the same time,
improve the log message to be in the usual "prefix: message" format.
https://bugzilla.gnome.org/show_bug.cgi?id=680759
|
| |
|
|
|
|
|
|
|
| |
priv->info can be NULL if the object is known by it's interfaces only
(like GDrive or GFile), or if the type is derived in JS, but object_instance_init
accessed it anyway for the dtrace probe.
A similar change is made to object_instance_finalize, to keep consistency.
|
|
|
|
|
|
|
| |
The GType system only logs a warning in that case, and it can
make bugs harder to track.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
| |
Int arrays are not string arrays
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=682305
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, all type safety checks were inside priv_from_js, which
returned NULL if the object was of the wrong class. Except that a
lot of code was not checking for NULL, causing potential crashes.
Also, we were only checking the JSClass, not the actual type of
object, so for example a function accepting a boxed would take in
any boxed instance, not just the right one (and then that could
crash JS code).
Rework this by splitting typechecking and private data access.
Internal API for typechecking is provided by all object classes
(object, boxed, union, param, gerror) and it takes the necessary
amount of information (GType, GIBaseInfo) to ensure type safety.
priv_from_js becomes unsafe, and thus ok to call in dangerous
data paths such as tracing and finalization.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
| |
For an (out) array length argument, we were accidentally subtracting
it from the expected argc.
https://bugzilla.gnome.org/show_bug.cgi?id=680215
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=680215
|
|
|
|
|
|
|
| |
Accessing the GType from the GIRegisteredTypeInfo is not free,
while caching it in the instance structure is also cleaner.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
| |
GI functions don't have lazy properties, so they don't need a
resolve hook.
This is mainly a code cleanup.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
|
|
| |
Previously object counters were defined as int, which allowed them
to be negative. Replacing with unsigned int revealed a number of
places where we weren't incrementing properly, in particular in
dynamic class definitions (prototypes are finalized, and thus would
decrement the counter).
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes so that the types are installed as dynamic types, and
thus loaded and unloaded on demand. In particular, resources such
as signal class closures are now properly released when the use count
of these types drops to zero.
Additionally, to avoid unloading too early, each GObject prototype
has a now a reference on the GObjectClass. This means that the above
only applies at context destruction, and preserves previous semantics
wrt property and signal installation.
https://bugzilla.gnome.org/show_bug.cgi?id=679688
|
|
|
|
|
|
|
| |
GValues inside flat arrays must be unset when not transferring
ownership, and GErrors must be freed after setting the exception.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
| |
The regress test depends on cairo-gobject which isn't on RHEL6.
|
| |
|
|
|
|
| |
It was deleted in an earlier commit.
|
| |
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=679897
|
|
|
|
|
|
|
|
| |
priv_from_js calls JS_BeginRequest when it refers to a dynamic JSClass
(such as that used by GObjects), and that causes a deadlock when
called from the GC thread
https://bugzilla.gnome.org/show_bug.cgi?id=678908
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=679138
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=679138
|
|
|
|
|
|
|
|
|
|
| |
Should fix a linker error building the test suite when using
-Wl,--no-undefined. This is a fairly aggressive fix; we probably
don't need to link all of the modules to gio, but on the other hand,
there's really not a strong reason not to, and for people using
-Wl,--as-needed any unnecessary linkage due to this will be removed.
https://bugzilla.gnome.org/show_bug.cgi?id=678957
|
| |
|