summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* minijasmine: Remove irrelevant commentPhilip Chimento2023-03-041-1/+0
| | | | | Calling this matter of opinion "lame" annoys me and is not the kind of example I want to set in this codebase.
* minijasmine: Remove unused stack filter linePhilip Chimento2023-03-041-1/+0
| | | | | The tag `<jasmine-start>` is no longer used, this has moved into resource:///org/gjs/jsunit/minijasmine-executor.js
* context: Use module name in promise reaction function debug tagPhilip Chimento2023-03-041-2/+2
| | | | | | 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.
* context: Use correct debug tag with promise reaction functionPhilip Chimento2023-03-041-2/+2
| | | | | | | 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.
* repo: Define namespace property on imports.gi after looking up _init()Philip Chimento2023-03-041-4/+4
| | | | | | | 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.
* repo: Check that GI module override function is callablePhilip Chimento2023-03-0410-2/+75
| | | | | 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.
* esm: Improve startup time by delaying imports of native and GI modulesPhilip Chimento2023-03-043-23/+17
| | | | | | | | | | | | | | | | | | | | | | 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.
* gi: Roll back change to imports.gi.versions object if gi.require() failsPhilip Chimento2023-03-042-6/+19
| | | | | 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.
* GLib: Remove circular dependency between GLib and ByteArrayPhilip Chimento2023-03-041-8/+5
| | | | | ByteArray.fromString() is already defined by _byteArrayNative and re-exported; while ByteArray.toGBytes() just calls new GLib.Bytes anyway.
* cleanup: Replace static_cast<GjsContext*> with runtime castPhilip Chimento2023-03-044-7/+5
| | | | | The runtime cast is defined anyway by the GObject macros, and allows turning runtime checking on or off at build time as desired.
* Merge branch 'trampoline-supports-instance-strings' into 'master'Philip Chimento2023-03-045-27/+51
|\ | | | | | | | | | | | | function: Do not leak strings returned by transfer-none trampolines Closes #519 See merge request GNOME/gjs!823
| * function: Do not leak strings returned by transfer-none trampolinesMarco Trevisan (Treviño)2023-03-045-27/+51
|/ | | | | | | | | | | | | 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
* Merge branch 'object-value-string-test-enable' into 'master'Philip Chimento2023-03-041-2/+0
|\ | | | | | | | | testGObjectValue: Enable creating object with a string property See merge request GNOME/gjs!826
| * testGObjectValue: Enable creating object with a string propertyMarco Trevisan (Treviño)2023-02-241-2/+0
| | | | | | | | This required GNOME/gobject-introspection!268 but that's now merged.
* | Merge branch 'signed-char-fix' into 'master'Philip Chimento2023-03-041-3/+3
|\ \ | | | | | | | | | | | | | | | | | | value: Use a signed char to old g_value_get_schar result Closes #529 See merge request GNOME/gjs!825
| * | gi/value: Cleanup schar setting codeMarco Trevisan (Treviño)2023-02-231-2/+2
| | | | | | | | | | | | | | | | | | 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.
| * | value: Use a signed char to old g_value_get_schar resultMarco Trevisan (Treviño)2023-02-231-1/+1
| |/ | | | | | | | | | | | | | | | | 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
* | Merge branch 'fix-gio-priorities' into 'master'Philip Chimento2023-03-011-3/+4
|\ \ | | | | | | | | | | | | Gio: Use proper default priority on async generators See merge request GNOME/gjs!827
| * | Gio: Use proper default priority on async generatorsMarco Trevisan (Treviño)2023-02-281-3/+4
| |/ | | | | | | Gio.DEFAULT_PRIORITY is undefined given that's exposed by GLib instead.
* | Merge branch 'more-gjs-apps' into 'master'Philip Chimento2023-02-271-18/+28
|\ \ | |/ |/| | | | | doc: Add more apps written in GJS See merge request GNOME/gjs!822
| * doc: Re-organize appsSonny Piers2023-02-251-17/+23
| | | | | | | | | | Merge GNOME Core and Circle apps - it's the best and most fair indication of quality we have.
| * doc: Remove Marker appSonny Piers2023-02-251-1/+0
| | | | | | | | Not written in GJS
| * doc: Remove Gnomit appSonny Piers2023-02-251-1/+0
| | | | | | | | | | | | A more up to date codebase is available in the fork "Commit". The Gnomit repository has been archived.
| * doc: add more apps written in GJSSonny Piers2023-02-251-0/+6
|/
* Merge branch 'news-typo-fix' into 'master'Marco Trevisan2023-02-231-1/+1
|\ | | | | | | | | NEWS: fix a typo causing codespell to fail See merge request GNOME/gjs!824
| * NEWS: fix a typo causing codespell to failMarco Trevisan (Treviño)2023-02-231-1/+1
|/
* release: Prepare for 1.75.21.75.2Philip Chimento2023-02-201-0/+80
|
* release: Include NEWS from stable branchPhilip Chimento2023-02-201-0/+12
|
* build: Pre-release version bumpPhilip Chimento2023-02-201-1/+1
|
* Merge branch 'proxy-init-promise' into 'master'Philip Chimento2023-02-212-1/+39
|\ | | | | | | | | | | | | Gio: Add support for initializing a DBus Proxy via a promise Closes #494 See merge request GNOME/gjs!794
| * Gio: Add support for initializing a DBus Proxy via a promiseMarco Trevisan (Treviño)2023-02-202-1/+39
|/ | | | | | | | | 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)
* Merge branch 'ewlsh/main-loop-hooks' into 'master'Philip Chimento2023-02-2113-72/+266
|\ | | | | | | | | | | | | Introduce runAsync() to run mainloops without blocking module resolution Closes #468 See merge request GNOME/gjs!732
| * jasmine: Port jasmine executor to async mainloopEvan Welsh2023-02-207-53/+131
| |
| * Introduce runAsync() to run main loops without blocking module resolutionEvan Welsh2023-02-206-19/+135
|/ | | | | | | | | | | | | | | 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
* Merge branch 'legacy-signals-connect-after' into 'master'Philip Chimento2023-02-203-117/+183
|\ | | | | | | | | Add legacy signals connectAfter method See merge request GNOME/gjs!805
| * signals: Simulate GObject's connect_after behavior on signalsMarco Trevisan (Treviño)2023-02-193-117/+183
|/ | | | | | | 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.
* Merge branch 'december-maintenance' into 'master'Philip Chimento2023-02-209-163/+109
|\ | | | | | | | | December maintenance See merge request GNOME/gjs!820
| * CI: Put testGtk4.js in 'dbus' suitePhilip Chimento2023-02-191-25/+34
| | | | | | | | | | | | 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.
| * function: Do not allow returning a transfer-none string from JS callbackPhilip Chimento2023-02-192-3/+17
| | | | | | | | | | | | | | | | | | | | | | 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.
| * arg-cache: Format hex flags value in error messagePhilip Chimento2023-02-191-1/+3
| | | | | | | | | | The counterpart to this error message in arg.cpp formats the flags value in hex; this message should too.
| * build: Use bool_yn for better summary formattingPhilip Chimento2023-02-191-2/+2
| | | | | | | | Thanks to Eli Schwartz for pointing this out.
| * build: Remove redundant checks for absolute pathsPhilip Chimento2023-02-191-4/+3
| | | | | | | | | | | | | | 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.
| * tests: Fix test descriptionPhilip Chimento2023-02-191-1/+1
| | | | | | | | | | This test is added twice, and was supposed to adapt its description each time.
| * debugger: Use spread syntax to override style propertyPhilip Chimento2023-02-191-3/+1
| | | | | | | | | | This was previously done with a slightly circuitous call to Object.assign(); it can be done more readably with spread syntax.
| * console: Use private fields and methodsPhilip Chimento2023-02-191-119/+43
| | | | | | | | | | | | 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.)
| * build: Use dependency get_variable() methodPhilip Chimento2023-02-192-2/+2
| | | | | | | | get_pkgconfig_variable() will be deprecated in a future Meson release.
| * build: Add check argument to Meson run_commandPhilip Chimento2023-02-191-1/+1
| | | | | | | | | | The default for this argument is going to switch to true in future releases, so make it explicitly false here.
| * test: Relax assertion in cr.textExtents() againPhilip Chimento2023-02-191-2/+2
|/ | | | | | | These are two more values that seem to depend on what fonts you have installed. See: #461
* Merge branch 'symbols-in-debugger' into 'master'Philip Chimento2023-02-208-18/+105
|\ | | | | | | | | Handle Symbol values in pretty-printer and debugger See merge request GNOME/gjs!819
| * debugger: Support Symbol valuesPhilip Chimento2023-01-016-6/+16
| | | | | | | | | | | | | | | | | | | | | | 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.