Browse Source

Fix Promise.wait() for fired promises

Failure introduced in 80ace36e4c
v0.7.4-release
Felix Geisendörfer 15 years ago
committed by Ryan Dahl
parent
commit
490cac0d7e
  1. 12
      src/node.js

12
src/node.js

@ -297,6 +297,18 @@ var eventsModule = createInternalModule('events', function (exports) {
var ret;
var hadError = false;
if (this.hasFired) {
ret = (this._values.length == 1)
? this._values[0]
: this.values;
if (this.hasFired == 'success') {
return ret;
} else if (this.hasFired == 'error') {
throw ret;
}
}
self.addCallback(function () {
if (arguments.length == 1) {
ret = arguments[0];

Loading…
Cancel
Save