| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
doc: Fix http-client.js example
See merge request GNOME/gjs!840
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
context: Clear all vectors of JS::Heap on dispose
Closes #472
See merge request GNOME/gjs!834
|
|/
|
|
|
|
|
|
| |
Otherwise we might still have some `JS::Heap`s lingering after
`JS_DestroyContext`, which will fail to destruct (crash) when their
destructors are called later in `~GjsContextPrivate()`.
Fixes: https://gitlab.gnome.org/GNOME/gjs/-/issues/472
|
|\
| |
| |
| |
| | |
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.
|
|\ \
| |/
|/|
| |
| | |
Better handling of callbacks during GC
See merge request GNOME/gjs!832
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When callback_closure() exits early, for example due to being called
during GC, the return value would not be initialized. This value is
often non-zero. If the callback is a source func of an idle or a timeout
this would then get interpreted as G_SOURCE_CONTINUE and the same would
repeat in the next iteration. If this happens fast enough, this results
in the entire process being seemingly frozen while spamming the log with
error messages.
To fix this always initialize the return value to 0 or a comparable
neutral value.
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1868
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| |/
|/|
| |
| |
| |
| | |
Use the mask for the GFlagsClass to compute valid values for flags passed from C
Closes #507
See merge request GNOME/gjs!829
|
| | |
|
|/
|
|
| |
Fix Errors
|
|\
| |
| |
| |
| | |
doc: Add Gio and GLib runAsync overrides
See merge request GNOME/gjs!833
|
|/ |
|
|\
| |
| |
| |
| | |
fix(build, tests): move `have_gtk4` to the appropriate place
See merge request GNOME/gjs!830
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
February maintenance
See merge request GNOME/gjs!828
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the promise job dispatcher is reset, its GCancellable is replaced
with a different instance. However, the original GCancellable instance was
passed to GjsContextPrivate::runJobs(), which aborts the job queue if the
GCancellable is cancelled.
This wasn't normally a problem, because the GCancellable isn't usually
cancelled. However, running JS with code coverage instrumentation starts
and stops the job dispatcher after every job, in order for the debugger
code to do its thing. So the GCancellable was getting cancelled and
immediately replaced with a fresh one, but the job queue was still getting
aborted.
This still didn't seem to have any noticeable effect until we merged the
runAsync() feature recently. From that point, async module evaluate
operations started getting dropped on the floor when code coverage was
active, which is very bad news.
The fix is to not hold on to the GCancellable across jobs. Instead of
checking whether the GCancellable is cancelled, instead check whether the
promise job dispatcher is running.
|
| |
| |
| |
| |
| | |
This adds a new debug topic, JS MAINLOOP, and adds debug log statements to
the promise job queue, GSource, dispatcher, and main loop machinery.
|
| | |
|
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
For debugging, make sure the module identifier is part of the promise
reaction function's debug tag, so that when we break on it we can tell
which module was being evaluated.
|
| |
| |
| |
| |
| |
| |
| | |
The reaction functions of the module evaluation promise accidentally had
their function IDs switched, leading to potential confusion when
debugging: a function called "async reject" would be called when the
module evaluation promise resolved, and vice versa.
|
| |
| |
| |
| |
| |
| |
| | |
We don't need the imports.gi.NameSpace property defined during the
property lookup of _init(), only when executing it. Defining it slightly
later allows us to roll back the import more effectively if the lookup
fails.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
By avoiding using import.meta.importSync() and imports.gi at the top level
of modules that we import during the bootstrap process, we speed up the
execution of a blank file by 15%, because we don't need to go into any of
the GI typelib machinery.
Now, the only modules imported at startup are _print, _encoding, _timers,
and console, in order to provide public global APIs.
I measured the 15% speedup with `perf stat -r 10 -B`. I also used Meson's
measurements of the test suite to see a noticeable effect: for example,
running the CommandLine test (which starts many instances of GJS) goes
goes from 5.4 to 4.9 seconds.
The cost of importing these modules is instead paid at the first time
they're used. This assumes that it's nearly zero cost to import the
modules a second time, because they're cached.
In addition, this should make debugging easier because you don't get a big
log spew of importing GLib if your script doesn't import GLib.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
ByteArray.fromString() is already defined by _byteArrayNative and
re-exported; while ByteArray.toGBytes() just calls new GLib.Bytes anyway.
|
|/
|
|
|
| |
The runtime cast is defined anyway by the GObject macros, and allows
turning runtime checking on or off at build time as desired.
|
|\
| |
| |
| |
| |
| |
| | |
function: Do not leak strings returned by transfer-none trampolines
Closes #519
See merge request GNOME/gjs!823
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| | |
testGObjectValue: Enable creating object with a string property
See merge request GNOME/gjs!826
|
| |
| |
| |
| | |
This required GNOME/gobject-introspection!268 but that's now merged.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
value: Use a signed char to old g_value_get_schar result
Closes #529
See merge request GNOME/gjs!825
|
| | |
| | |
| | |
| | |
| | |
| | | |
We still need to use an int32 to hold its result (as that's where a
signed char is stored in JS), but if the conversion is fine we need to
cast its value to signed char. Do it using C++ style now though.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
char and signed char are the same in most of platforms, but that's not
always true such as in arm64, s390x, ppc64el and others.
See: https://buildd.debian.org/status/fetch.php?pkg=gjs&arch=arm64&ver=1.75.2-1&stamp=1676991213&raw=0
Closes: #529
|
|\ \
| | |
| | |
| | |
| | | |
Gio: Use proper default priority on async generators
See merge request GNOME/gjs!827
|
| |/
| |
| |
| | |
Gio.DEFAULT_PRIORITY is undefined given that's exposed by GLib instead.
|
|\ \
| |/
|/|
| |
| | |
doc: Add more apps written in GJS
See merge request GNOME/gjs!822
|
| |
| |
| |
| |
| | |
Merge GNOME Core and Circle apps - it's the best and most fair
indication of quality we have.
|
| |
| |
| |
| | |
Not written in GJS
|
| |
| |
| |
| |
| |
| | |
A more up to date codebase is available in the fork "Commit".
The Gnomit repository has been archived.
|