| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=680215
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement tracing for GObjects and use it so that signal handlers
are rooted to the objects they're connected, and not the global
object. This means that if the object goes away and the only thing
referring to it is the handler function, it is recognized as a
cycle by the GC and collected, reducing memory leaks.
Other closures, as well as callback trampolines and vfuncs, are still
rooted in the usual way.
https://bugzilla.gnome.org/show_bug.cgi?id=678504
|
|
|
|
|
|
|
| |
Remove tabs, use modern GError bindings, remove comments that
are no longer relevant.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
|
|
|
| |
Soon new API wrappers will be introduced, and this will help
reusing code.
https://bugzilla.gnome.org/show_bug.cgi?id=669350
|
|
|
|
|
|
|
|
|
|
| |
Previously GErrors were transformed into plain Error with a custom
message, which removed the code and domain metadata. This commit
introduces a new class hierarchy (derived from GLib.Error) for each
enumeration representing an error domain, and modifies existing
code to throw instances of that when a function fails.
https://bugzilla.gnome.org/show_bug.cgi?id=591480
|
|
|
|
|
|
| |
Found with make valgrind-check. We should run it more often.
https://bugzilla.gnome.org/show_bug.cgi?id=676843
|
|
|
|
|
|
|
|
| |
If we don't require a type_info in a foreign API, this will make it easier
to use the foreign API from another place in the code. Swap out the use
of type_info with the interface info that the type info contains.
https://bugzilla.gnome.org/show_bug.cgi?id=671687
|
| |
|
|
|
|
|
|
|
| |
Imported from gnome-shell, this provides printf-like formatting to
JavaScript.
https://bugzilla.gnome.org/show_bug.cgi?id=675479
|
|
|
|
|
|
|
|
|
|
| |
GjsDBus is likely to be present in system directories too, if
an older version of gjs is installed, and this can cause symbol
conflicts between system libgjs-gdbus.so and libgjs.so.
Also, it could be that some day we want to do something else with
it.
https://bugzilla.gnome.org/show_bug.cgi?id=675018
|
|
|
|
|
|
|
|
| |
These functions are useful sometimes (for example when building
a PolkitSubject), and have no equivalent in GLib, therefore it's
appropriate to place them in the system module.
https://bugzilla.gnome.org/show_bug.cgi?id=646187
|
|
|
|
|
|
|
| |
Single quotes must be used, or the method_name concatenation is not
recognized.
https://bugzilla.gnome.org/show_bug.cgi?id=675018
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=607589
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In ebc84492, we added a way to get a GType for a constructor.
Let's expand this to objects (by way of the JavaScript 'constructor'
property), and then use this mechanism to improve GType detection
in GValues. This can be used with APIs like GtkListStore that force
the user to create a GValue and expect the right type.
https://bugzilla.gnome.org/show_bug.cgi?id=669848
|
|
|
|
|
| |
Use gjs_define_object_class to create a dynamic JSClass for the
newly registered gtype, which doesn't have any introspection info.
|
|
|
|
|
|
|
| |
Introduces a new Gi.add_interface internal method, that wraps
g_type_add_interface(). Introduces support for interface vfuncs
when hooking them, and for retrieving their C implementation from
prototypes.
|
|
|
|
|
|
|
|
| |
Introduce Gi.signal_new, which is a thin wrapper over g_signal_newv,
and then make GObject.Class read a map of signal descriptions as
parameters to the class.
Also, use g_signal_override_class_closure to connect "on_foo" to
the respective signals.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To support installing custom properties, we must be able to have JS context and
JS object in set_property before even g_object_newv() returns. This is achieved
by using other internal construct properties that are set if the object is of a
custom type.
Use this so that we can implement a sane default implementation of
do_get_property/do_set_property that simply sets the corresponding field on the
JS object. Implementations that need more complex behavior can either use ES5
or Mozilla getters/setters, or implement their own override of do_get_property
and do_set_property.
|
|
|
|
|
|
|
|
|
|
| |
Allow GObject subclasses to override parent vfuncs. We automatically hook up
such vfuncs if the name of the function is prefixed with "vfunc_".
Some of the code here related to finding the vfunc's implementor struct was
stolen from pygobject. Maybe it should go in libgirepository instead.
https://bugzilla.gnome.org/show_bug.cgi?id=663492
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=663492
|
|
|
|
|
|
|
|
| |
Classes created with new Lang.Class are now first class objects
themselves, and Lang.Class is itself a Lang.Class (to the extent
permitted by JS). It is therefore possible to inherit from Lang.Class
and create custom python-like metaclasses, instances of which are
actual instantiable classes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are three functions in here:
* addressOf: Extremely useful when debugging a gjs process with a
native code debugger like GDB. Add "print(imports.system.addressOf(foo))"
for an object, then take the number it prints "12345" and paste into
gdb like:
p (JSObject*) 12345
* breakpoint: Wrapper for G_BREAKPOINT(). Insert a SIGTRAP which,
if the process is under a debugger, causes a breakpoint. Combines
nicely with the above.
* gc: Forces a full garbage collection.
Based on a patch by Colin Walters <walters@verbum.org>
https://bugzilla.gnome.org/show_bug.cgi?id=630412
|
|
|
|
|
|
|
|
|
| |
Since we now require mozjs185, it always needs a const char*
Silence btw warnings about argv sometimes not being used
https://bugzilla.gnome.org/show_bug.cgi?id=666331
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=665432
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=664360
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=664360
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=663490
|
|
|
|
|
|
|
|
| |
Uponing entering a method from another on the same object, the
function wrapper must save the previous value of __caller__, or
susbsequents calls to parent() would fail.
https://bugzilla.gnome.org/show_bug.cgi?id=664437
|
|
|
|
|
|
|
|
|
| |
By setting Abstract: true in the class parameters, you can now
obtain a class that will throw upon instantiation. The class can
still have an _init (that derived class can call) and otherwise works
like all other classes.
https://bugzilla.gnome.org/show_bug.cgi?id=664437
|
|
|
|
|
|
|
|
|
|
| |
Use ES5 reflection methods to obtain and manipulate property
descriptors, instead of copying the property values with for-in.
This allows for non-enumerable properties, prevents Object.prototype
properties from being iterated, allows setting .configurable, and
most important allows accessor properties with the usual syntax.
https://bugzilla.gnome.org/show_bug.cgi?id=664437
|
|
|
|
|
| |
It should be OK to call a DBus function asynchronously and ignore the
result.
|
|
|
|
| |
This code was obviously never tested or run.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The current strategy of using __proto__ and _init to implement prototype chains
is non-standard and error-prone. Use something a bit more automatic to help us
along.
Additionally, when patches come for inheriting from gi objects, we can use the
existing framework to hoist ourselves without too much effort.
https://bugzilla.gnome.org/show_bug.cgi?id=662582
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=656074
|
|
|
|
|
|
| |
Add some missing cairo_image_surface getters bindings.
https://bugzilla.gnome.org/show_bug.cgi?id=655447
|
|
|
|
|
|
|
|
|
|
| |
Introduces a new introspected library, libgjs-gdbus, which hosts
GjsDBusImplementation, a standalone, signal-driven GDBusInterfaceSkeleton.
This is exposed, thanks to overrides, as Gio.DBusExportedObject, where
it gains some JS code to expose normal JS objects on the bus
and some glue to use E4X in place of XML strings for introspection.
https://bugzilla.gnome.org/show_bug.cgi?id=622921
|
| |
|
|
|
|
|
| |
This is a wrapper for Object.defineProperty() but with a fallback for
older versions of spidermonkey.
|
|
|
|
|
| |
The standard Function.bind() works, but doesn't support passing
additional arguments.
|
|
|
|
|
|
|
| |
The int16/uint16 type (signature: 'q') is lacking the conversion rule
from DBus value to JavaScript. Easy enough to add.
https://bugzilla.gnome.org/show_bug.cgi?id=653332
|
|
|
|
|
|
|
|
| |
No consumer of gjs is interested in gjs without gi, let's stop
pretending it's an addon module. All of the other modules link
to it anyways, and in reality to integrate things well, we
need to be able to cross call between gjs core -> gi and the
reverse.
|
| |
|
|
|
|
|
|
|
|
| |
This only covers the proxy (client) side, for the skeleton (server)
side we still need glue code (but it is easy to generate it using
gdbus-binding-tool, for example)
https://bugzilla.gnome.org/show_bug.cgi?id=622921
|
|
|
|
|
|
|
| |
Using JS overrides, adds glue code that packs and unpacks GVariants
into JS objects (hash maps, arrays and primitive types)
https://bugzilla.gnome.org/show_bug.cgi?id=622344
|
|
|
|
|
|
|
| |
Implement this by assuming input is UTF-8, convert it to UTF-16, and
pass it to the "UC" variants of the JSAPI.
https://bugzilla.gnome.org/show_bug.cgi?id=581028
|
|
|
|
|
|
|
| |
Override modules are JS modules that can subsume or replace native
modules from GObject Introspection.
https://bugzilla.gnome.org/show_bug.cgi?id=646633
|