Closed edipoReboucas closed 3 years ago
Won't this result in failing to reject promises that throw exceptions when resolved more than once?
I can write a test for this scenario.
If you provide a code snippet with this exact scenario, it will be very helpful.
Promises generated with Utils::task throw a error when they are canceled ou resolved before TaskQueue:run is called. With this behavior, we can't cancel a promise generated with Utils::task method, a useful behavior. In this fix the waitFn function generated in Utils:task is checking if promise is alredy settle, and skip the call to task function in this case.