aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-04-19 09:30:13 +0800
committerbitpshr <mail@bitpshr.net>2018-04-19 09:30:13 +0800
commit1ef6528921263fb9dbae35476a1d9827e1d87508 (patch)
treeb0a4da9a783e902ec4e984f94d892542868756bb /app
parent6dbdc87713a652dec4c90fa792dda08d613d4198 (diff)
downloadtangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.tar
tangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.tar.gz
tangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.tar.bz2
tangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.tar.lz
tangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.tar.xz
tangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.tar.zst
tangerine-wallet-browser-1ef6528921263fb9dbae35476a1d9827e1d87508.zip
Add JSDoc to various background scripts
Diffstat (limited to 'app')
-rw-r--r--app/scripts/edge-encryptor.js12
-rw-r--r--app/scripts/inpage.js4
-rw-r--r--app/scripts/popup-core.js8
3 files changed, 13 insertions, 11 deletions
diff --git a/app/scripts/edge-encryptor.js b/app/scripts/edge-encryptor.js
index 5f6699746..d2e985790 100644
--- a/app/scripts/edge-encryptor.js
+++ b/app/scripts/edge-encryptor.js
@@ -7,11 +7,11 @@ const Unibabel = require('browserify-unibabel')
*/
class EdgeEncryptor {
/**
- * Encrypts an arbitrary JavaScript object to cypher text
+ * Encrypts an arbitrary JavaScript object to ciphertext
*
- * @param {string} password Password used to unlock a cryptographic key
+ * @param {string} password Used to generate a key to encrypt the data
* @param {Object} dataObject Data to encrypt
- * @returns {Object} Object containing cypher text, generation vectors, and salt
+ * @returns {Promise<Object>} Promise resolving to an object with ciphertext
*/
encrypt (password, dataObject) {
var salt = this._generateSalt()
@@ -34,10 +34,10 @@ class EdgeEncryptor {
}
/**
- * Decrypts an arbitrary JavaScript object from cypher text
+ * Decrypts an arbitrary JavaScript object from ciphertext
*
- * @param {string} password Password used to unlock a cryptographic key
- * @param {string} text Cypher text of an encrypted JavaScript object
+ * @param {string} password Used to generate a key to decrypt the data
+ * @param {string} text Ciphertext of an encrypted JavaScript object
* @returns {Promise<Object>} Promise resolving to copy of decrypted JavaScript object
*/
decrypt (password, text) {
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 798af78bf..6d16eebd4 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -52,7 +52,9 @@ inpageProvider.publicConfigStore.subscribe(function (state) {
var __define
/**
- * Caches reference to global define object and deletes it
+ * Caches reference to global define object and deletes it to
+ * avoid conflicts with other global define objects, such as
+ * AMD's define function
*/
function cleanContextForImports () {
__define = global.define
diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js
index 5a5fa95f9..69fbcf49c 100644
--- a/app/scripts/popup-core.js
+++ b/app/scripts/popup-core.js
@@ -12,7 +12,7 @@ module.exports = initializePopup
/**
* Asynchronously initializes the MetaMask popup UI
*
- * @param {{ container: Element, connectionStream: any }} config Popup configuration object
+ * @param {{ container: Element, connectionStream: * }} config Popup configuration object
* @param {Function} cb Called when initialization is comlete
*/
function initializePopup ({ container, connectionStream }, cb) {
@@ -26,7 +26,7 @@ function initializePopup ({ container, connectionStream }, cb) {
/**
* Establishes streamed connections to background scripts and a Web3 provider
*
- * @param {any} connectionStream PortStream instance establishing a background connection
+ * @param {*} connectionStream PortStream instance establishing a background connection
* @param {Function} cb Called when controller connection is established
*/
function connectToAccountManager (connectionStream, cb) {
@@ -41,7 +41,7 @@ function connectToAccountManager (connectionStream, cb) {
/**
* Establishes a streamed connection to a Web3 provider
*
- * @param {any} connectionStream PortStream instance establishing a background connection
+ * @param {*} connectionStream PortStream instance establishing a background connection
*/
function setupWeb3Connection (connectionStream) {
var providerStream = new StreamProvider()
@@ -56,7 +56,7 @@ function setupWeb3Connection (connectionStream) {
/**
* Establishes a streamed connection to the background account manager
*
- * @param {any} connectionStream PortStream instance establishing a background connection
+ * @param {*} connectionStream PortStream instance establishing a background connection
* @param {Function} cb Called when the remote account manager connection is established
*/
function setupControllerConnection (connectionStream, cb) {