Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

prevent leakage

  • Loading branch information...
commit 9622f358644db9b96909e5e91c5af77a7f84033e 1 parent 4a8041e
@eldargab authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/box.js
View
9 lib/box.js
@@ -50,11 +50,11 @@ Box.prototype.execute = function (app) {
this.isSync
? this.done(this.fn.call(proxy, get))
: this.fn.call(proxy, get, function (error, val) {
- if (error) return app._raise(self.path, error)
+ if (error) return self.error(app, error)
self.done(val)
})
} catch (e) {
- app._raise(this.path, e)
+ this.error(app, e)
}
}
@@ -68,6 +68,11 @@ Box.prototype.done = function (val) {
this.callbacks = null
}
+Box.prototype.error = function (app, err) {
+ this.callbacks = null
+ app._raise(this.path, err)
+}
+
Box.prototype.onready = function (cb) {
this.callbacks = this.callbacks || []
this.callbacks.push(cb)
Please sign in to comment.
Something went wrong with that request. Please try again.