- Allow functions created by
Promise.asyncto accept legacy node-style callback arguments. - Switch to
eslint, updatemocha, and ensure we test up to node 9.
- Add a cache to ensure that only a single
prfunPromiseclass is constructed even when using the wrapper interface. - Update npm dev dependencies.
- Optimize the
Promisesubclass constructor to avoid costly overhead in ES5 environments. The slow ES6 path is only used if necessary for correctness (or if the native Promise implementation uses ES6 class syntax). - Added
Promise#then0to the API, which is a shim when a nativePromise#then0is not available. SomePromiseimplementations provide this method, which is much more efficient than callingPromise#thenand discarding the result. - Used
Promise#then0in internal implementations where appropriate, includingPromise.async(where the use of generators can now yield better performance than chaining promises in the usual way).
- Ensure that
Promise.asyncalways returns aPromise. (Previously if the function returned immediately without yielding the result would not be wrapped in a promise.)
- Improve compatibilty with environments missing a definition of
Object.setPrototypeOf.
- Switch from
es6-shimtocore-jsby default. - Fix our subclass code to follow the latest ES6 specification.
- Work around some bugs in native Promise implementations to allow
prfunto use native promises.
- Breaking change:
prfunnow creates a subclass ofPromiseby default, instead of smashing the globalPromise. This only works if yourPromiseimplementation properly supports the ES6 subclass semantics --es6-shimis known to implement the ES6 spec properly. To smash the globalPromiselike in the bad old days, userequire('prfun/smash').
- Fix potential resource leak in
Promise#timeout.
- Added
Promise#tap,Promise#filter. - Bug fix to
promisifywith named arguments (an array of names as second parameter).
- Breaking change to
promisifyAPI: following the lead ofdenodeifyinrsvpandqversion 2, thepromisifyfunction has been changed to eliminate the magic variadic argument inference. Thepromisifyfunction now takes an explicit second parameter,names. If thenamesparameter is missing or falsy, then a single argument is used to resolve the promise. If thenamesparameter istrue, then the promise is resolved with an array of the variadic arguments to the callback. If thenamesparameter is an array, the array names the variadic arguments, and the promise is resolved with an object containing fields with those names.
See comments on bower's issue #1403 and this commit on q's v2 branch for more details.
- Initial release.