Promises returned from generators are not resolved automatically #64
Labels
Comments
To be fair, in C# you would write The Bluebird behavior seems nice (and correct) but I see your point - this is inconsistent with the way promises unwrap. Definitely something we need to think about. |
Yea confirmed as bug. |
@petkaantonov are you sure returning a promise acting like in thenables is the correct behavior? |
Yes it is always without any doubt a bug if you get a promise as a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Q, if an async generator returns a promise, that promise is resolved and the resolved value is passed on. In Bluebird, the promise itself is passed along as the next value:
Q v1.0.0:
Bluebird v0.11.6-1:
The workaround in Bluebird is to yield on the promise before returning it:
But that seems like an unnecessary extra step that could be avoided, and I think it goes against expectations coming from Promise.try(). Is this behavior intentional?
The text was updated successfully, but these errors were encountered: