From ea43158d4043b01058afd7411c84aa38b61c2009 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 16 Aug 2018 14:40:53 +0200 Subject: [PATCH] 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. --- lang/js/src/Key.js | 15 +++++---------- 1 file 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'); + } } } @@ -388,15 +392,6 @@ class GPGME_UserId { setProperty(keys[i], data[keys[i]]); } - /** - * 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