Promise._setImmediateFn
and Promise._setUnhandledRejectionFn
This allows subclassing Promise without rewriting functions
Promise._setImmediateFn(<immediateFn>)
has been deprecated. Use Promise._immediateFn = <immediateFn>
instead.Promise._setUnhandledRejectionFn(<rejectionFn>)
has been deprecated. Use Promise._unhandledRejectionFn = <rejectionFn>
instead. These functions will be removed in the next major version.Fixed bug where setTimeout was set to 1 instead of 0 for async execution
Allowed Subclassing. #27
Changed possibly unhanded warnings to use asap function instead of setTimeout
Removed non standard functionality of passing multiple params to Promise.all. You must pass an array now. You must change this code
Promise.all(prom1, prom2, prom3);
to this
Promise.all([prom1, prom2, prom3]);
IE8 does not have console, unless you open the developer tools. This fix checks to makes sure console.warn is defined before calling it.
bower.json had Promise.js instead of promise.js
Fixed promise.js in package.json. It was accidently published as Promise.js
New version fixing this major bug https://github.com/taylorhakes/promise-polyfill/pull/17
This is considered a breaking change because people may have been using this functionality. If you would like to keep version 2 functionality, set Promise._setImmediateFn on promise-polyfill
like the code below.
var Promise = require('promise-polyfill'); Promise._setImmedateFn(function(fn) { setTimeout(fn, 1); });
Removed dead code Promise.immedateFn and added Promise._setImmediateFn(fn);
Simplified attaching to global object
Fixed Webworkers missing window object
Changed the following line
module.exports = root.Promise ? root.Promise : Promise;
to
module.exports = Promise;
This means the library will not use built-in Promise by default. This allows for more consistency.
You can easily add the functionality back.
var Promise = window.Promise || require('promise-polyfill');
Added Promise.immediateFn to allow changing the setImmedate function
Promise.immediateFn = window.setAsap;
this