|
@ -233,7 +233,7 @@ var eventsModule = createInternalModule('events', function (exports) { |
|
|
|
|
|
|
|
|
exports.Promise.prototype.emitSuccess = function() { |
|
|
exports.Promise.prototype.emitSuccess = function() { |
|
|
if (this.hasFired) return; |
|
|
if (this.hasFired) return; |
|
|
this.hasFired = true; |
|
|
this.hasFired = 'success'; |
|
|
this._clearTimeout(); |
|
|
this._clearTimeout(); |
|
|
|
|
|
|
|
|
this._values = Array.prototype.slice.call(arguments); |
|
|
this._values = Array.prototype.slice.call(arguments); |
|
@ -242,7 +242,7 @@ var eventsModule = createInternalModule('events', function (exports) { |
|
|
|
|
|
|
|
|
exports.Promise.prototype.emitError = function() { |
|
|
exports.Promise.prototype.emitError = function() { |
|
|
if (this.hasFired) return; |
|
|
if (this.hasFired) return; |
|
|
this.hasFired = true; |
|
|
this.hasFired = 'error'; |
|
|
this._clearTimeout(); |
|
|
this._clearTimeout(); |
|
|
|
|
|
|
|
|
this._values = Array.prototype.slice.call(arguments); |
|
|
this._values = Array.prototype.slice.call(arguments); |
|
@ -261,7 +261,7 @@ var eventsModule = createInternalModule('events', function (exports) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
exports.Promise.prototype.addCallback = function (listener) { |
|
|
exports.Promise.prototype.addCallback = function (listener) { |
|
|
if (this.hasFired) { |
|
|
if (this.hasFired === 'success') { |
|
|
return listener.apply(this, this._values); |
|
|
return listener.apply(this, this._values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -269,7 +269,7 @@ var eventsModule = createInternalModule('events', function (exports) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
exports.Promise.prototype.addErrback = function (listener) { |
|
|
exports.Promise.prototype.addErrback = function (listener) { |
|
|
if (this.hasFired) { |
|
|
if (this.hasFired === 'error') { |
|
|
listener.apply(this, this._values); |
|
|
listener.apply(this, this._values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|