不要怂,就是干,撸起袖子干!

Commit 98bd1f44 by Sascha Depold

lol@english

1 parent 5546c264
Showing with 5 additions and 3 deletions
...@@ -8,7 +8,7 @@ module.exports = (function() { ...@@ -8,7 +8,7 @@ module.exports = (function() {
this.emitters = [] this.emitters = []
this.fails = [] this.fails = []
this.finished = false this.finished = false
this.runned = false this.wasRunning = false
this.eventEmitter = null this.eventEmitter = null
emitters = emitters || [] emitters = emitters || []
...@@ -25,7 +25,7 @@ module.exports = (function() { ...@@ -25,7 +25,7 @@ module.exports = (function() {
QueryChainer.prototype.run = function() { QueryChainer.prototype.run = function() {
var self = this var self = this
this.eventEmitter = new Utils.CustomEventEmitter(function() { this.eventEmitter = new Utils.CustomEventEmitter(function() {
self.runned = true self.wasRunning = true
finish.call(self) finish.call(self)
}) })
return this.eventEmitter.run() return this.eventEmitter.run()
...@@ -49,7 +49,7 @@ module.exports = (function() { ...@@ -49,7 +49,7 @@ module.exports = (function() {
var finish = function(result) { var finish = function(result) {
this.finished = (this.finishedEmits == this.emitters.length) this.finished = (this.finishedEmits == this.emitters.length)
if(this.finished && this.runned) { if(this.finished && this.wasRunning) {
var status = this.fails.length == 0 ? 'success' : 'failure' var status = this.fails.length == 0 ? 'success' : 'failure'
result = this.fails.length == 0 ? result : this.fails result = this.fails.length == 0 ? result : this.fails
this.eventEmitter.emit(status, result) this.eventEmitter.emit(status, result)
......
...@@ -27,6 +27,8 @@ module.exports = (function() { ...@@ -27,6 +27,8 @@ module.exports = (function() {
return this return this
} }
//private
var bindClient = function() { var bindClient = function() {
this.client.on('error', this.bindClientFunction) this.client.on('error', this.bindClientFunction)
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!