diff options
| author | Maximilian Krambach <[email protected]> | 2018-08-16 12:40:53 +0000 | 
|---|---|---|
| committer | Maximilian Krambach <[email protected]> | 2018-08-16 12:40:53 +0000 | 
| commit | ea43158d4043b01058afd7411c84aa38b61c2009 (patch) | |
| tree | bf075ad346c7b26d1c209d623487e99c91b85ab1 /lang/js/src | |
| parent | js: wrong object assumed in recent commit (diff) | |
| download | gpgme-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/src')
| -rw-r--r-- | lang/js/src/Key.js | 15 | 
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}  | 
