| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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.
|
|/ |
|
|\
| |
| |
| |
| | |
NEWS: fix a typo causing codespell to fail
See merge request GNOME/gjs!824
|
|/ |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Gio: Add support for initializing a DBus Proxy via a promise
Closes #494
See merge request GNOME/gjs!794
|
|/
|
|
|
|
|
|
|
| |
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)
|
|\
| |
| |
| |
| |
| |
| | |
Introduce runAsync() to run mainloops without blocking module resolution
Closes #468
See merge request GNOME/gjs!732
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All modules are promises. If Gtk.Application.run() or
GLib.MainLoop.run() is called within a module it will block all other
promises as run() is a synchronous, blocking function. To work around
this there is now a setMainLoopHook function exposed which runs a
callback after module resolution is complete. This allows APIs to
"install" a mainloop asynchronously.
For Gio.Application and GLib.MainLoop there are now runAsync() versions
of their run() functions. runAsync() returns a Promise which will
resolve once the mainloop has exited.
Fixes #468
|
|\
| |
| |
| |
| | |
Add legacy signals connectAfter method
See merge request GNOME/gjs!805
|
|/
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| | |
December maintenance
See merge request GNOME/gjs!820
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
The counterpart to this error message in arg.cpp formats the flags value
in hex; this message should too.
|
| |
| |
| |
| | |
Thanks to Eli Schwartz for pointing this out.
|
| |
| |
| |
| |
| |
| |
| | |
Path concatenation with / already handles absolute paths correctly if
the right-hand side is an absolute path.
Thanks to Eli Schwartz for pointing this out.
|
| |
| |
| |
| |
| | |
This test is added twice, and was supposed to adapt its description each
time.
|
| |
| |
| |
| |
| | |
This was previously done with a slightly circuitous call to
Object.assign(); it can be done more readably with spread syntax.
|
| |
| |
| |
| |
| |
| | |
This is a modernization of the console module. (I'm a bit surprised that
the methods still work when transferred as own properties to the global
console object, but apparently they do.)
|
| |
| |
| |
| | |
get_pkgconfig_variable() will be deprecated in a future Meson release.
|
| |
| |
| |
| |
| | |
The default for this argument is going to switch to true in future
releases, so make it explicitly false here.
|
|/
|
|
|
|
|
| |
These are two more values that seem to depend on what fonts you have
installed.
See: #461
|
|\
| |
| |
| |
| | |
Handle Symbol values in pretty-printer and debugger
See merge request GNOME/gjs!819
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|