aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-08-16 12:40:53 +0000
committerMaximilian Krambach <[email protected]>2018-08-16 12:40:53 +0000
commitea43158d4043b01058afd7411c84aa38b61c2009 (patch)
treebf075ad346c7b26d1c209d623487e99c91b85ab1 /lang/js
parentjs: wrong object assumed in recent commit (diff)
downloadgpgme-ea43158d4043b01058afd7411c84aa38b61c2009.tar.gz
gpgme-ea43158d4043b01058afd7411c84aa38b61c2009.zip
js: avoid async getters
-- * src/Key.js get armored was returning a promise on async keys. As getters should not do that, it returns an error in this case.
Diffstat (limited to 'lang/js')
-rw-r--r--lang/js/src/Key.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/lang/js/src/Key.js b/lang/js/src/Key.js
index eeb27035..aa419053 100644
--- a/lang/js/src/Key.js
+++ b/lang/js/src/Key.js
@@ -303,7 +303,11 @@ export class GPGME_Key {
* @returns {String|GPGME_Error} The armored public Key block.
*/
get armored(){
- return this.get('armored', true);
+ if (this.isAsync === true){
+ return gpgme_error('KEY_NO_INIT');
+ } else {
+ return this.get('armored');
+ }
}
}
@@ -389,15 +393,6 @@ class GPGME_UserId {
}
/**
- * Validates a subkey property against {@link validUserIdProperties} and
- * sets it if validation is successful
- * @param {String} property
- * @param {*} value
- * @param private
- */
-
-
- /**
* Fetches information about the user
* @param {String} property Information to request
* @returns {String | Number}