Skip to content

Commit

Permalink
Fixing an issue in which the ES6 promise module was erratically included
Browse files Browse the repository at this point in the history
  • Loading branch information
Halim Qarroum committed Sep 21, 2015
1 parent e33fce1 commit 22c3062
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

/**
Expand All @@ -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.
*/
Expand Down

0 comments on commit 22c3062

Please sign in to comment.