From 22c30625e6d601d8fe1cbea38f2f58f56478e718 Mon Sep 17 00:00:00 2001 From: Halim Qarroum Date: Mon, 21 Sep 2015 15:14:32 +0200 Subject: [PATCH] Fixing an issue in which the ES6 promise module was erratically included --- lib/index.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/index.js b/lib/index.js index 2c3bd87..728b630 100644 --- a/lib/index.js +++ b/lib/index.js @@ -14,22 +14,18 @@ */ (function (name, definition) { if (typeof define === 'function' && define.amd) { - // Exporting the Promise polyfill. - this.ES6Promise.polyfill(); // Defining the module in an AMD fashion. - define(['blueimp-md5', 'popsicle', 'proxify-url'], definition); + define(['blueimp-md5', 'popsicle', 'proxify-url', 'es6-promise'], definition); } else if (typeof module !== 'undefined' && module.exports) { - // Exporting the Promise polyfill. - require('es6-promise').polyfill(); // Exporting the module for Node.js/io.js. module.exports = definition( require('blueimp-md5').md5, require('popsicle'), - require('proxify-url') + require('proxify-url'), + require('es6-promise') ); } else { - this.ES6Promise.polyfill(); - var instance = definition(this.md5, this.popsicle, this.proxify); + var instance = definition(this.md5, this.popsicle, this.proxify, this.ES6Promise); var old = this[name]; /** @@ -42,8 +38,13 @@ }; this[name] = instance; } - })('gravatar', function (md5, popsicle, proxify) { - + })('gravatar', function (md5, popsicle, proxify, es6) { + + /** + * Polyfill ES6 Promise. + */ + es6.polyfill(); + /** * The Gravatar service base URL. */