Closed Feasul closed 9 years ago
Great catch! You've also reminded me that I need to move those format helpers to their own module so they can actually be unit tested :)
Extracted them in this branch: https://github.com/cujojs/when/tree/extract-format-module
Need to write a few unit tests for them now.
This just landed in 3.6.4. Thanks again!
Was glad to help. When is a great library.
In case promise is rejected with a 'null' and unhadled rejection is reported check for error type fails in 'formatError' method. The reason for it is that 'typeof null' is also an 'object' (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof).
Therefore an additional check for 'e' to also not be a 'null' is added to 'formatError' method code.