| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
installed-tests/meson: Add tests dependencies on gjs console and GjsPrivate
See merge request GNOME/gjs!835
|
| |
| |
| |
| |
| |
| | |
It's used by gjs internally, so add it as default tests dependencies.
Without this `meson test` would fail without compiling before.
|
| |
| |
| |
| | |
We require the console to run the tests so add it as dependencies.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the gjs process is logging to the systemd journal directly via the
glib logging functions, the stack trace would get logged indirectly via
stderr. This however is not guaranteed to get added to the journal at
the same time as the error messages logged via glib. This is especially
noticeable when triggered from an endless loop or an idle callback. In
some cases it even can result in the stack trace not getting logged at
all.
There is currently no public API in mozjs to dump a stack trace directly
to a string from arbitrary threads, only to files, so this uses
open_memstream() as a workaround.
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1868
|
| |
|
|
|
|
|
| |
Calling this matter of opinion "lame" annoys me and is not the kind of
example I want to set in this codebase.
|
|
|
|
|
| |
The tag `<jasmine-start>` is no longer used, this has moved into
resource:///org/gjs/jsunit/minijasmine-executor.js
|
|
|
|
|
| |
Previously, we would return the override function if it was null, or a
non-callable object, and then try to call it. Add tests for this case.
|
|
|
|
|
| |
If something like gi.require('GLib', '1.75') fails, then we don't want the
faulty version number remaining on the imports.gi.versions object.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a VFunc or a callback returns a transfer-none string we were
breaking the introspection because it was causing a leak.
Now, in case these strings are returned by vfunc's of an object, we can
just safely associate them to the object using qdata, while in case
we're handling a callback we can use GLib internal strings to hold these
strings just once in memory. While this is technically still a waste
we're leaking just once, so it shouldn't be a big deal.
Closes: #519
|
|
|
|
| |
This required GNOME/gobject-introspection!268 but that's now merged.
|
|
|
|
|
|
|
|
|
| |
Add a newAsync() static method to DBus proxy wrappers, that returns a
promise that allows to initialize a proxy object asynchronously,
keeping around all the wrappers as expected, and allowing to use nicer
try/catch syntax.
(Edited from Gio.makeProxyPromise to a static method by Philip)
|
| |
|
|
|
|
|
|
|
| |
GObject signals have a connect_after function that we don't have in the
gjs core signals, while it can be useful in some situations.
So introduce it.
|
|
|
|
|
|
| |
This is a temporary fix for GTK 4 trying to acquire a message bus on
startup, until we figure out what magic environment variable will
prevent that.
|
|
|
|
|
|
|
|
|
|
|
| |
In order to marshal a string from JS into C, we have to create a temporary
UTF-8 string. That string cannot be returned as transfer-none, because
there is no obvious place to keep it alive so that it can live as long as
the C code needs it to. See #519 for more explanation.
This is currently "supported" but causes a memory leak. Instead, throw
when creating a callback or vfunc in JS that would otherwise have this
memory leak.
|
|
|
|
|
| |
This test is added twice, and was supposed to adapt its description each
time.
|
|
|
|
| |
get_pkgconfig_variable() will be deprecated in a future Meson release.
|
|
|
|
|
|
|
| |
These are two more values that seem to depend on what fonts you have
installed.
See: #461
|
|
|
|
|
|
|
|
|
|
|
| |
We get this for free already for Symbol primitive values and Symbol
property keys and values, due to it being supported in the
pretty-printer. For the 'keys' command, we need to start using
Object.getOwnPropertySymbols() to get the Symbol property keys.
While we are at it, switch from using Object.keys() which only gives
enumerable string/number property keys, to Object.getOwnPropertyNames(),
in order to be able to debug non-enumerable properties as well.
|
|
|
|
|
| |
Introduce a new property key formatter which formats a Symbol property
key in brackets.
|
|
|
|
|
|
|
| |
This formats Symbols as the source text with which they should be able
to be constructed. It makes a distinction between registered symbols
(created with Symbol.for()), well-known symbols (always existing), and
regular symbols (created with Symbol()).
|
| |
|
|
|
|
| |
closes #515
|
|
|
|
|
|
|
|
| |
When a function uses caller-allocated C-arrays are used, we can easily
create such structures when we know the size of the array elements.
GI tests at:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/370
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
gobject: Guard against null JS wrapper in set/get property
Closes #510
See merge request GNOME/gjs!813
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The wrapper object may be disassociated from the GObject if dispose has
been run. In that case, the pointers in the get/set property vfuncs may
be null. Handle that case with a warning and don't get or set the
property.
Closes: #510
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We often reference connection IDs, so now we can use a more optimized
native way to handle connections without having to iterate them all the
times.
This could have been implemented using the newer Map() object, but sadly
it's still way slower than using normal objects.
|
|\ \
| |/
|/|
| |
| |
| |
| | |
Fix using g-i introspected function as callback
Closes #518
See merge request GNOME/gjs!809
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is basically a revert of commit 7140cac8, although so much has
changed in the meantime that none of the revert applied cleanly, so it's
more of an "un-rewrite". This fixes a regression that has been present for
almost exactly 4 years.
Storing a JSFunction* pointer in closures did not take into account the
fact that not all callable JSObjects have an associated JSFunction. They
could be exotic objects with a [[Call]] method. In particular,
introspected functions are this, so this prevented g-i function objects
from being used as signal handlers.
(Less importantly, the same probably applied to callable Proxy objects.)
Also adds a regression test so that this doesn't happen again.
Closes: #518
|
| |
| |
| |
| | |
See https://gitlab.gnome.org/GNOME/gjs/-/issues/519
|
|/
|
|
|
|
| |
With a newer g-i we can enable more tests that were not running so far,
so bump the dependency and enable the tests that were depending on MR's
that landed already.
|
| |
|
| |
|
|
|
|
|
| |
In case the log is severe enough it's better to fill such information by
default.
|
|
|
|
|
|
| |
Just fetch the error trace at printer function so that we can just use
this at lower level without requiring explicitly using the printer when
using trace()
|
|
|
|
|
| |
This is what GLib does all the times for C code, in JS we can easily do
it as well as we have traces, for now do it only for console.trace().
|
|
|
|
| |
Also ensure this in a test
|
| |
|
|
|
|
|
|
| |
When a D-Bus implementation returns a value from a getter, check if
it is variant matching the expected property signature. If it is,
skip packing a new variant and just return the value.
|
|
|
|
|
|
| |
We don't require GLib 2.72 for anything else, so it makes sense to
conditionally define the override for GObject.BindingGroup.bind_full().
If GLib is too old then the override (and its tests) are skipped.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Gio: Promisify GDBusProxy.init_async by default
Closes #494
See merge request GNOME/gjs!790
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some code may promisify it after that it has been overridden, this means
that when called we may not use the original method correctly as the
function won't have the arguments set anymore and thus its length will
be 0, causing the assumption included in commit 58840261 not to be true
anymore.
Since the function is already a wrapper, we can safely override it to be
a promise and then override it again. Allowing code simplifications and
being more future-proof, when all the async functions will be promises
by default.
Fixes: #494
|
|/
|
|
| |
It makes sense to be able to use a static method even from a subtype
|
|
|
|
|
|
|
|
|
| |
These functions can crash if used from JS, because they take a raw
pointer. Add an override that calls the appropriate type-safe method
instead, on a best-effort basis; not all of these exist. In any case, the
crashes should be prevented.
Closes: #496
|
| |
|