js: Simplify promisify() calls
If the finish function isn't specified, promisify will now try to use the async name without '_async'/'_begin' suffix (if any) and '_finish' appended. Everything except IBus uses a variation of that pattern, so there's quite a bit of boilerplate we get to remove… Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2174>
This commit is contained in:

committed by
Marge Bot

parent
928f3288e9
commit
5442266f28
@ -15,10 +15,9 @@ const Util = imports.misc.util;
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
|
||||
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
|
||||
Gio._promisify(NM.Client, 'new_async', 'new_finish');
|
||||
Gio._promisify(NM.Client.prototype,
|
||||
'check_connectivity_async', 'check_connectivity_finish');
|
||||
Gio._promisify(Gio.DBusConnection.prototype, 'call');
|
||||
Gio._promisify(NM.Client, 'new_async');
|
||||
Gio._promisify(NM.Client.prototype, 'check_connectivity_async');
|
||||
|
||||
const NMConnectionCategory = {
|
||||
INVALID: 'invalid',
|
||||
|
Reference in New Issue
Block a user