diff options
author | Sonny Piers <sonny@fastmail.net> | 2022-05-29 14:13:13 +0200 |
---|---|---|
committer | Sonny Piers <sonny@fastmail.net> | 2022-05-29 14:13:13 +0200 |
commit | d103072e42e4b4952877dbee75c3b5ab909ce732 (patch) | |
tree | a1b46f93156923d217a0b5f3e27254e101352a74 | |
parent | ba35b10b1b9d215c7ab9ce41e571e7313a32a62a (diff) | |
download | gjs-d103072e42e4b4952877dbee75c3b5ab909ce732.tar.gz |
Make DBus session and system props non-enumerable
-rw-r--r-- | modules/core/overrides/Gio.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/core/overrides/Gio.js b/modules/core/overrides/Gio.js index 6cc29b17..511d6c32 100644 --- a/modules/core/overrides/Gio.js +++ b/modules/core/overrides/Gio.js @@ -457,13 +457,6 @@ function _init() { Gio = this; Gio.DBus = { - get session() { - return Gio.bus_get_sync(Gio.BusType.SESSION, null); - }, - get system() { - return Gio.bus_get_sync(Gio.BusType.SYSTEM, null); - }, - // Namespace some functions get: Gio.bus_get, get_finish: Gio.bus_get_finish, @@ -478,6 +471,21 @@ function _init() { unwatch_name: Gio.bus_unwatch_name, }; + Object.defineProperties(Gio.DBus, { + 'session': { + get() { + return Gio.bus_get_sync(Gio.BusType.SESSION, null); + }, + enumerable: false, + }, + 'system': { + get() { + return Gio.bus_get_sync(Gio.BusType.SYSTEM, null); + }, + enumerable: false, + }, + }); + Gio.DBusConnection.prototype.watch_name = function (name, flags, appeared, vanished) { return Gio.bus_watch_name_on_connection(this, name, flags, appeared, vanished); }; |