From 68a012deb3b501d7417778be12c88bd475a37cb5 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 1 Aug 2018 12:51:12 +0200 Subject: 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 --- lang/js/src/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lang/js/src/index.js') 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 -- cgit v1.2.3