Releases: taylorhakes/promise-polyfill
Fix case in bower.json
bower.json had Promise.js instead of promise.js
promise.js case fix in package.json
Fixed promise.js in package.json. It was accidently published as Promise.js
Unhandled Rejections and Other Fixes
- Added unhandled rejection warnings to the console
- Removed Grunt, jasmine and other unused code
- Renamed Promise.js to lowercase promise.js in multiple places
Fixed shadowing issue on setTimeout
New version fixing this major bug #17
Updated setTimeout to not be affected by test mocks
In version 2 mocking setTimeout in Jasmine and Sinon would affect promise-polyfill
resolution. Since native Promise is not affected by mocks, this library has been updated to behave the same way.
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);
});
Promise._setImmedateFn
Removed dead code Promise.immedateFn and added Promise._setImmediateFn(fn);
Simplified Global detection
v2.0.2 Simplified attaching to global object
Webworker bugfixes
Bug fixes:
- Webworkers missing window object
v2.0.0: Removed degrading to built in promise
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;