diff --git a/src/node.js b/src/node.js index 052651de0b..e31e000d03 100644 --- a/src/node.js +++ b/src/node.js @@ -264,7 +264,7 @@ var eventsModule = createInternalModule('events', function (exports) { exports.Promise.prototype.addCallback = function (listener) { if (this.hasFired === 'success') { - return listener.apply(this, this._values); + listener.apply(this, this._values); } return this.addListener("success", listener); diff --git a/test/mjsunit/test-promise.js b/test/mjsunit/test-promise.js index 2992f93665..149c07e2a0 100644 --- a/test/mjsunit/test-promise.js +++ b/test/mjsunit/test-promise.js @@ -24,13 +24,13 @@ a.addErrback(function(error) { }); a.emitSuccess(TEST_VALUE); -a.addCallback(function(value) { +assert.ok(a.addCallback(function(value) { assert.equal(TEST_VALUE, value); expectedCallbacks.a2--; -}); -a.addErrback(function(error) { +})); +assert.ok(a.addErrback(function(error) { assert.notEqual(TEST_VALUE, error, 'late'); -}); +})); // Test regular & late errback binding var b = new Promise(); @@ -48,10 +48,10 @@ b.addErrback(function(value) { // Test late errback binding var c = new Promise(); c.emitError(TEST_VALUE); -c.addErrback(function(value) { +assert.ok(c.addErrback(function(value) { assert.equal(TEST_VALUE, value); expectedCallbacks.c1--; -}); +})); // Test errback exceptions var d = new Promise();