A Promise A+ implementation for ES3.
npm install promises3
Promise implemented by this project have passed the Promise/A+ test.
tag, it will act as an polyfill, which means that create the Promise class in the global scope when it dosen't exist.
Promise class.
promises3 (require("promises3")).
Promise.prototype.toString are directly inherited from Object.prototype.toString and not have been overwritten. Only when Symbol.toStringTag is available, the result of promise.toString() and Object.prototype.toString.call(promise) is guaranteed to be "[object Promise]".
Promise.all, Promise.allSettled an other static functions takes ArrayLike as Iterable.
Promise.any is implemented. An Exception class called AggregateError which is needed by Promise.any is also implemented and exported. However, they cannot be fully polyfilled under ES5. As these 2 features are still in working draft (see MDN) and not be included in any main-stream browsers, using it is strongly deprecated.
Promise object has keys embraced by "[[]]". These properties should be seen as private properties and should not be modified externally.
. is not allowed. You can use promise["catch"] and promise["finally"] instead of promise.catch and promise.finally. Some tools, like babel/plugin-transform-member-expression-literals may help you covert these codes automatically.