[gjs: 5/7] modified _promisify function




commit cd1cf5c49e445fec4caa70fb94f988627a9a0a62
Author: veena <veenanitks gmail com>
Date:   Tue Jun 1 16:03:52 2021 +0530

    modified _promisify function

 installed-tests/js/testGio.js | 4 ++--
 modules/core/overrides/Gio.js | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/installed-tests/js/testGio.js b/installed-tests/js/testGio.js
index a2ad915b..4ad134c8 100644
--- a/installed-tests/js/testGio.js
+++ b/installed-tests/js/testGio.js
@@ -65,11 +65,11 @@ describe('Sorting in ListStore', function () {
 
 describe('Promisify function', function () {
     it("doesn't crash when async function is not defined", function () {
-        expect(() => Gio._promisify(Gio.Subprocess.prototype, 'commuicate_utf8_async', 
'communicate_utf8_finish')).toThrowError('commuicate_utf8_async is not defined');
+        expect(() => Gio._promisify(Gio.Subprocess.prototype, 'commuicate_utf8_async', 
'communicate_utf8_finish')).toThrowError(/commuicate_utf8_async/);
     });
 
     it("doesn't crash when finish function is not defined", function () {
-        expect(() => Gio._promisify(Gio.Subprocess.prototype, 'communicate_utf8_async', 
'commuicate_utf8_finish')).toThrowError('commuicate_utf8_finish is not defined');
+        expect(() => Gio._promisify(Gio.Subprocess.prototype, 'communicate_utf8_async', 
'commuicate_utf8_finish')).toThrowError(/commuicate_utf8_finish/);
     });
 });
 
diff --git a/modules/core/overrides/Gio.js b/modules/core/overrides/Gio.js
index 811dc614..8d97f81d 100644
--- a/modules/core/overrides/Gio.js
+++ b/modules/core/overrides/Gio.js
@@ -405,10 +405,10 @@ function* _listModelIterator() {
 
 function _promisify(proto, asyncFunc, finishFunc) {
     if (proto[asyncFunc] === undefined)
-        throw new Error(`${asyncFunc} is not defined`);
+        throw new Error(`${asyncFunc}`);
 
     if (proto[finishFunc] === undefined)
-        throw new Error(`${finishFunc} is not defined`);
+        throw new Error(`${finishFunc}`);
 
     if (proto[`_original_${asyncFunc}`] !== undefined)
         return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]