diff --git a/bower.json b/bower.json index 95af45bd..a4039d91 100644 --- a/bower.json +++ b/bower.json @@ -34,12 +34,12 @@ "format-io": "~0.9.6", "jquery": "~2.1.4", "menu": "~0.7.9", - "promise-polyfill": "~2.1.0", "rendy": "~1.1.0", "execon": "~1.2.8", "emitify": "~2.0.0", "findit": "~1.1.4", "philip": "~1.3.2", - "smalltalk": "~1.6.5" + "smalltalk": "~1.6.5", + "promise-polyfill": "~3.0.0" } } diff --git a/modules/promise-polyfill/.bower.json b/modules/promise-polyfill/.bower.json index 63cbef81..e4624c3a 100644 --- a/modules/promise-polyfill/.bower.json +++ b/modules/promise-polyfill/.bower.json @@ -1,6 +1,6 @@ { "name": "promise-polyfill", - "version": "2.1.0", + "version": "3.0.0", "homepage": "https://github.com/taylorhakes/promise-polyfill", "authors": [ "Taylor Hakes" @@ -25,14 +25,14 @@ "test", "tests" ], - "_release": "2.1.0", + "_release": "3.0.0", "_resolution": { "type": "version", - "tag": "2.1.0", - "commit": "7ee8e28671e2e7ff0304ea37c3d1fb1288645362" + "tag": "3.0.0", + "commit": "edce456da7e95a9a536bfebcbd98f0e109a653d4" }, "_source": "git://github.com/taylorhakes/promise-polyfill.git", - "_target": "~2.1.0", + "_target": "~3.0.0", "_originalSource": "promise-polyfill", "_direct": true } \ No newline at end of file diff --git a/modules/promise-polyfill/Promise.js b/modules/promise-polyfill/Promise.js index 47453e50..7d1eb784 100644 --- a/modules/promise-polyfill/Promise.js +++ b/modules/promise-polyfill/Promise.js @@ -1,5 +1,9 @@ (function(root) { + // Store setTimeout reference so promise-polyfill will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var setTimeout = setTimeout; + // Use polyfill for setImmediate for performance gains var asap = (typeof setImmediate === 'function' && setImmediate) || function(fn) { setTimeout(fn, 1); }; @@ -187,4 +191,4 @@ root.Promise = Promise; } -})(this); \ No newline at end of file +})(this); diff --git a/modules/promise-polyfill/Promise.min.js b/modules/promise-polyfill/Promise.min.js index fe61cac6..c1e22fef 100644 --- a/modules/promise-polyfill/Promise.min.js +++ b/modules/promise-polyfill/Promise.min.js @@ -1,2 +1,2 @@ -/*! promise-polyfill 2.1.0 */ -!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this); \ No newline at end of file +/*! promise-polyfill 2.1.3 */ +!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void k(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=j,k="function"==typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this); \ No newline at end of file diff --git a/modules/promise-polyfill/README.md b/modules/promise-polyfill/README.md index 41c8b9c6..a450d282 100644 --- a/modules/promise-polyfill/README.md +++ b/modules/promise-polyfill/README.md @@ -2,10 +2,14 @@ Promises/A+ logo -Promise [![Build Status](https://travis-ci.org/taylorhakes/promise-polyfill.png?branch=master)](https://travis-ci.org/taylorhakes/promise-polyfill) -============= +# Promise +[![travis][travis-image]][travis-url] -Lightweight promise polyfill for the browser and node. A+ Compliant. It is a perfect polyfill IE, Firefox or any other browser that does not support native promises. +[travis-image]: https://img.shields.io/travis/taylorhakes/promise-polyfill.svg?style=flat +[travis-url]: https://travis-ci.org/taylorhakes/promise-polyfill + + +Lightweight ES6 Promise polyfill for the browser and node. Adheres closely to the spec. It is a perfect polyfill IE, Firefox or any other browser that does not support native promises. This implementation is based on [then/promise](https://github.com/then/promise). It has been changed to use the prototype for performance and memory reasons. diff --git a/modules/promise-polyfill/package.json b/modules/promise-polyfill/package.json index 8817f83d..4415b8ed 100644 --- a/modules/promise-polyfill/package.json +++ b/modules/promise-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "promise-polyfill", - "version": "2.1.0", + "version": "3.0.0", "description": "Lightweight promise polyfill. A+ compliant", "main": "Promise.js", "scripts": {