mirror of https://github.com/nodejs/node.git
parent
80ace36e4c
commit
490cac0d7e
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…
Reference in New Issue