diff options
author | Maximilian Krambach <[email protected]> | 2018-05-04 10:56:59 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-05-04 10:56:59 +0000 |
commit | cf075846fb48c8d71937100d2c45069d37d54a38 (patch) | |
tree | 01b25208634229a48d2ec490324d11e7b6af534d /lang/js/src/Key.js | |
parent | js: Added browser testing for unit tests (diff) | |
download | gpgme-cf075846fb48c8d71937100d2c45069d37d54a38.tar.gz gpgme-cf075846fb48c8d71937100d2c45069d37d54a38.zip |
js: fixing errors found by testing
--
* Key.js: Error code for wrong parameter in createKey should be
"PARAM_WRONG"
* Helpers.js: The property openpgpjs-like Objects were checked for in
toKeyIdArray was not defined.
* src/permittedOperations.js: updated more expectations and assumptions
for the native API
Diffstat (limited to 'lang/js/src/Key.js')
-rw-r--r-- | lang/js/src/Key.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lang/js/src/Key.js b/lang/js/src/Key.js index 6d3cf17d..075a190e 100644 --- a/lang/js/src/Key.js +++ b/lang/js/src/Key.js @@ -35,13 +35,15 @@ import { Connection } from './Connection'; export function createKey(fingerprint, parent){ if (!isFingerprint(fingerprint)){ - return gpgme_error('KEY_INVALID'); + return gpgme_error('PARAM_WRONG'); } if ( parent instanceof Connection){ return new GPGME_Key(fingerprint, parent); } else if ( parent.hasOwnProperty('connection') && parent.connection instanceof Connection){ return new GPGME_Key(fingerprint, parent.connection); + } else { + return gpgme_error('PARAM_WRONG'); } } |