diff --git a/src/node.js b/src/node.js index e31e000d03..026234bafb 100644 --- a/src/node.js +++ b/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];