summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2023-02-28 18:01:31 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2023-02-28 18:01:31 +0100
commit8e1dc133796d4216f9ff681cd4675adfc5baa158 (patch)
tree51259390682da98e0f4c03c4fb3a9a5da8bf5360
parent6a18579ea02add0fdd84eaa116e786376d5c2e2f (diff)
downloadgjs-8e1dc133796d4216f9ff681cd4675adfc5baa158.tar.gz
Gio: Use proper default priority on async generators
Gio.DEFAULT_PRIORITY is undefined given that's exposed by GLib instead.
-rw-r--r--modules/core/overrides/Gio.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/core/overrides/Gio.js b/modules/core/overrides/Gio.js
index 85fcde98..f7629ea8 100644
--- a/modules/core/overrides/Gio.js
+++ b/modules/core/overrides/Gio.js
@@ -625,7 +625,8 @@ function _init() {
}
};
- Gio.InputStream.prototype.createAsyncIterator = async function* createAsyncIterator(count, ioPriority = Gio.PRIORITY_DEFAULT) {
+ Gio.InputStream.prototype.createAsyncIterator = async function* createAsyncIterator(
+ count, ioPriority = GLib.PRIORITY_DEFAULT) {
const self = this;
function next() {
@@ -670,7 +671,7 @@ function _init() {
function next() {
return new Promise((resolve, reject) => {
- self.next_files_async(1, Gio.PRIORITY_DEFAULT, null, (_self, res) => {
+ self.next_files_async(1, GLib.PRIORITY_DEFAULT, null, (_self, res) => {
try {
const files = self.next_files_finish(res);
resolve(files.length === 0 ? null : files[0]);
@@ -683,7 +684,7 @@ function _init() {
function close() {
return new Promise((resolve, reject) => {
- self.close_async(Gio.PRIORITY_DEFAULT, null, (_self, res) => {
+ self.close_async(GLib.PRIORITY_DEFAULT, null, (_self, res) => {
try {
resolve(self.close_finish(res));
} catch (err) {