Skip to content

Commit b0219b2

Browse files
authored
Merge pull request #534 from thewillhuang/patch-1
use bluebird instead of es6-promise
2 parents 99b9c01 + f35a69e commit b0219b2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

promise.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function createConnection (opts) {
66
if (!Promise) {
77
throw new Error('no Promise implementation available.' +
88
'Use promise-enabled node version or pass userland Promise' +
9-
' implementation as parameter, for example: { Promise: require(\'es6-promise\').Promise }');
9+
' implementation as parameter, for example: { Promise: require(\'bluebird\') }');
1010
}
1111
return new Promise(function (resolve, reject) {
1212
coreConnection.once('connect', function (connectParams) {
@@ -168,7 +168,12 @@ PromiseConnection.prototype.prepare = function () {
168168

169169
function createPool (opts) {
170170
var corePool = core.createPool(opts);
171-
var Promise = opts.Promise || global.Promise || require('es6-promise');
171+
var Promise = opts.Promise || global.Promise;
172+
if (!Promise) {
173+
throw new Error('no Promise implementation available.' +
174+
'Use promise-enabled node version or pass userland Promise' +
175+
' implementation as parameter, for example: { Promise: require(\'bluebird\') }');
176+
}
172177

173178
var promisePool = {
174179
getConnection: function () {

0 commit comments

Comments
 (0)