Merge pull request #1560 from strongloop/fix/forgotten-bluebird-reference
Don't load Bluebird for createPromiseCallback
This commit is contained in:
commit
7ff771c6bf
|
@ -1,6 +1,5 @@
|
||||||
exports.createPromiseCallback = createPromiseCallback;
|
exports.createPromiseCallback = createPromiseCallback;
|
||||||
|
|
||||||
var Promise = global.Promise = require('bluebird');
|
|
||||||
function createPromiseCallback() {
|
function createPromiseCallback() {
|
||||||
var cb;
|
var cb;
|
||||||
|
|
||||||
|
@ -12,7 +11,7 @@ function createPromiseCallback() {
|
||||||
return cb;
|
return cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
var promise = new Promise(function(resolve, reject) {
|
var promise = new global.Promise(function(resolve, reject) {
|
||||||
cb = function(err, data) {
|
cb = function(err, data) {
|
||||||
if (err) return reject(err);
|
if (err) return reject(err);
|
||||||
return resolve(data);
|
return resolve(data);
|
||||||
|
|
|
@ -47,3 +47,7 @@ assert.isFunc = function(obj, name) {
|
||||||
assert(obj, 'cannot assert function ' + name + ' on object that doesnt exist');
|
assert(obj, 'cannot assert function ' + name + ' on object that doesnt exist');
|
||||||
assert(typeof obj[name] === 'function', name + ' is not a function');
|
assert(typeof obj[name] === 'function', name + ' is not a function');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!('Promise' in global)) {
|
||||||
|
global.Promise = require('bluebird');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue