diff options
Diffstat (limited to 'deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js')
-rw-r--r-- | deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js b/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js index 9e5e513f56..6312674b51 100644 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js +++ b/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js @@ -3,7 +3,7 @@ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.4+314e4831 + * @version v4.2.6+9869a4bc */ (function (global, factory) { @@ -1109,15 +1109,19 @@ var Promise$2 = function () { var promise = this; var constructor = promise.constructor; - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; + if (isFunction(callback)) { + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); }); - }); + } + + return promise.then(callback, callback); }; return Promise; |