diff options
author | Maximilian Krambach <[email protected]> | 2018-08-01 10:51:12 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-08-01 10:51:12 +0000 |
commit | 68a012deb3b501d7417778be12c88bd475a37cb5 (patch) | |
tree | 453fd5544589dbc51968f2138f7816b69ae83c66 /lang/js/src/index.js | |
parent | js: fix confusion about loop in last commit (diff) | |
download | gpgme-68a012deb3b501d7417778be12c88bd475a37cb5.tar.gz gpgme-68a012deb3b501d7417778be12c88bd475a37cb5.zip |
js: make init export immutable
--
* src/index.js: The export now uses a freezed Object, which does not
allow for simply overwriting the init method by e.g. a third-party
library.
* BrowsertestExtension: Added some tests trying if decryption of bad
data properly fails
Diffstat (limited to 'lang/js/src/index.js')
-rw-r--r-- | lang/js/src/index.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lang/js/src/index.js b/lang/js/src/index.js index 2fed95f9..51f07538 100644 --- a/lang/js/src/index.js +++ b/lang/js/src/index.js @@ -34,7 +34,7 @@ import { Connection } from './Connection'; */ function init(){ return new Promise(function(resolve, reject){ - let connection = Object.freeze(new Connection); + const connection = Object.freeze(new Connection); connection.checkConnection(false).then( function(result){ if (result === true) { @@ -48,6 +48,5 @@ function init(){ }); } -export default { - init: init -};
\ No newline at end of file +const exportvalue = Object.freeze({init:init}); +export default exportvalue;
\ No newline at end of file |