diff options
author | Avi Zajac <avirzajac@gmail.com> | 2018-08-17 14:54:12 -0700 |
---|---|---|
committer | Avi Zajac <avirzajac@gmail.com> | 2018-08-19 13:53:29 -0700 |
commit | 42be3ff2016134877a52561573f78f8c20020004 (patch) | |
tree | 527c033de0328498e18eef5254990ff3a1dfc484 | |
parent | fe12be991408c1c4b9f1b5649f331eb9ae336520 (diff) | |
download | gjs-42be3ff2016134877a52561573f78f8c20020004.tar.gz |
Temporary fix for Gio.File.prototype
Issue #189 details the current dilemma of being unable to add or
monkeypatch methods on a GObject interface. At this time developers
must add an additional line of code to their applications to use
Gio.File.prototype. This is a temporary fix faking it until such a
fix has been made for that issue.
Example:
promisify(Gio._LocalFilePrototype, load_contents_async, load_contents_finish);
-rw-r--r-- | modules/overrides/Gio.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/overrides/Gio.js b/modules/overrides/Gio.js index 23a0648e..0092b99b 100644 --- a/modules/overrides/Gio.js +++ b/modules/overrides/Gio.js @@ -401,4 +401,7 @@ function _init() { // ListStore Gio.ListStore.prototype[Symbol.iterator] = _listModelIterator; + + // Temporary Gio.File.prototype fix + Gio._LocalFilePrototype = Gio.File.new_for_path('').constructor.prototype; } |