aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/ensnare.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-06-22 05:24:28 +0800
committerGitHub <noreply@github.com>2016-06-22 05:24:28 +0800
commit537328b5298a42f9d20862d42b9012babcda373c (patch)
tree9a5728447f5b23a918b4a23c12e91ea1b702e527 /app/scripts/lib/ensnare.js
parentbb7788373d9c234313d651d88c72c18a8e4ca0aa (diff)
parentd7c3e8e9f5182576eb4a990d385ff8ce4ebd417c (diff)
downloadtangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.gz
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.bz2
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.lz
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.xz
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.zst
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.zip
Merge pull request #303 from MetaMask/AutoLint
Auto lint
Diffstat (limited to 'app/scripts/lib/ensnare.js')
-rw-r--r--app/scripts/lib/ensnare.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/lib/ensnare.js b/app/scripts/lib/ensnare.js
index b70330a5a..6100f7c79 100644
--- a/app/scripts/lib/ensnare.js
+++ b/app/scripts/lib/ensnare.js
@@ -1,21 +1,21 @@
module.exports = ensnare
// creates a proxy object that calls cb everytime the obj's properties/fns are accessed
-function ensnare(obj, cb){
+function ensnare (obj, cb) {
var proxy = {}
- Object.keys(obj).forEach(function(key){
+ Object.keys(obj).forEach(function (key) {
var val = obj[key]
switch (typeof val) {
case 'function':
- proxy[key] = function(){
+ proxy[key] = function () {
cb()
val.apply(obj, arguments)
}
return
default:
Object.defineProperty(proxy, key, {
- get: function(){ cb(); return obj[key] },
- set: function(val){ cb(); return obj[key] = val },
+ get: function () { cb(); return obj[key] },
+ set: function (val) { cb(); obj[key] = val; return val },
})
return
}