-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
i am seeing this issue in 1.2.1. it's easiest to describe via assertion
'use strict';
var assert = require('assert');
var Promise = require('bluebird');
describe('Promise', function() {
describe('#nodeify', function() {
it('receives an undefined result argument', function(done) {
Promise.resolve().nodeify(function() {
// a both a null Error and an undefined result are provided.
assert.equal(2, arguments.length);
assert.strictEqual(null, arguments[0]);
assert.strictEqual(undefined, arguments[1]);
// frameworks such as async will see `undefined` as an actual result value
// and honor it accordingly. there are side-effects in the case of async.waterfall,
// where the `callback` provided to a series function will become the 2nd argument,
// since the 1st argument is the `undefined` result value handed downstream by #nodeify.
// it would be more backward-compatible for #nodeify to provide a 1-argument signature --
// `(null)` as filler for the missing Error -- to the Node.js continuation callback
// when the upstream result value is `undefined`.
done();
});
});
});
});
Metadata
Metadata
Assignees
Labels
No labels